Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gothic II Untold Chapter
#1
[Image: guc.png]

Acum este oficial, noul Gothic Multiplayer a fost lansat. Germanul Mainclain pune la dispozitie un nou multiplayer, acesta a publicat si open source, astfel permite tuturor celor interesati sa vada cum este sincronizat Gothic Multiplayer.

Orice altceva, cum ar fi chat-ul, vremea, calculul dmg-ului ruleaza in fisierele serverului, oferind o posibilitate usoara de utilizat si programat.

Limbajul de programare folosit de aceasta data este C#.

Link Oficial: Gothic II Untold Chaper

Momente ale zilei+ploaie. Author: Mainclain. (DayTime.cs)
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GUC.Server.Scripting;
using GUC.Server.Scripting.Objects;

namespace GUC.Server.Scripts
{
    class DayTime
    {
        protected long timeStart = 0;
        public void Init()
        {
            timeStart = DateTime.Now.Ticks;

            Timer timer = new Timer(10000 * 1000* 3);//Alle 3 Sekunden!
            timer.OnTick += new Events.TimerEvent(onTick);

            timer.Start();
        }

        int day = -1;

        public void onTick()
        {
            long time = DateTime.Now.Ticks - (timeStart);
            time *= 24*48;//*1 => Echt-Zeit! *24 => 1Stunde => 1 Tag
            TimeSpan ts = new TimeSpan(time);
            
            World.setTimeFast(ts.Days, (byte)ts.Hours, (byte)ts.Minutes);
        
            if (ts.Days > day && ts.Hours > 12)
            {
                day = ts.Days;
                //Calculating Rain:
                Random rand = new Random();
                double startRain =  12.0 + rand.NextDouble() * 23;
                startRain %= 24.0;

                double maxEndTime = 36.0 - startRain;
                if (startRain < 12.0)
                    maxEndTime = 12.0 - startRain;

                if (maxEndTime < 1.0)
                {
                    Console.WriteLine("Kein regen heute!");
                    return;
                }
                maxEndTime -= 1.0;
                double endRain = (startRain + rand.NextDouble() * maxEndTime + 1.0);

                byte startHour = (byte)startRain;
                byte startMinute = (byte)((startRain - startHour) * 60);
                byte endHour = (byte)endRain;
                byte endMinute = (byte)((endRain - endHour) * 60);
                Console.WriteLine(startHour+":"+startMinute+" | "+endHour+":"+endMinute);
                World.setRainTime(World.WeatherType.Snow, startHour, startMinute, endHour, endMinute);
            }
        }
    }
}

Basic Chat System. Author: Mainclain. (Chat.cs)
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GUC.Server.Scripting.GUI;
using GUC.Server.Scripting.Objects.Character;
using GUC.Server.Scripting;

namespace GUC.Server.Scripts
{
class Chat
{
protected MessagesBox mB;
protected TextBox tB;
public void Init()
{
tB = new TextBox("", "Font_Old_20_White.TGA", 0, 0x800, 0x0D, 0x54, 0x1B);
mB = new MessagesBox("Font_Old_20_White.TGA", 8, 0, 0);

tB.TextSended += new Events.TextBoxMessageEventHandler(textBoxMessageReceived);

tB.show();
mB.show();

Player.playerSpawns += new Events.PlayerEventHandler(playerSpawn);
Player.playerDisconnects += new Events.PlayerEventHandler(playerDisconnect);
}

public void playerSpawn(Player player)
{
mB.addLine(255, 255, 255, 255, player.Name + " betritt den Server");
}

public void playerDisconnect(Player player)
{
mB.addLine(255, 255, 255, 255, player.Name+" verlässt den Server");
}

public void textBoxMessageReceived(TextBox tb, Player pl, String message)
{
String upperMessage = message.ToUpper();

if (upperMessage.StartsWith("/REVIVE"))
{
pl.revive();
return;
}

mB.addLine(pl, 255, 255, 255, 255, pl.Name + ": " + message);
Player[] players = pl.getNearPlayers(2000);
foreach (Player player in players)
{
mB.addLine(player, 255, 255, 255, 255, pl.Name + ": " + message);
}
}
}
}

In open source, in folderul ServerScripts gasiti multe alte fisiere pentru serverul vostru.

Open source pentru acest multiplayer gasiti aici.

Pentru a putea folosi fisierele din open source este nevoie de compile folosind Visual Studio.

Pentru a configura serverul este nevoie sa mergeti in folderul Server/Config si sa deschideti intr-un editor de text server.config

Code:
<?xml version="1.0"?>
<ServerOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ServerName>Test-Server</ServerName>
  <Port>9054</Port>
  <Slots>20</Slots>
  <password />
  <Modules />
  <AdditionalLibs>
    <string>Mono.Data.Sqlite.dll</string>
  </AdditionalLibs>
  <useScriptedFile>false</useScriptedFile>
  <generateScriptedFile>true</generateScriptedFile>
</ServerOptions>
FlowerFlower
replyReply
#2
Si asta inseamna ca ?
Mai pe intelesul nostru. Haha
replyReply
#3
(07-14-2014, 06:53 PM)soul of darknes Wrote: Si asta inseamna ca ?
Mai pe intelesul nostru. Haha

Doar va prezentam noul Gothic Multiplayer.
FlowerFlower
replyReply
#4
Serverul comunitatii se va muta pe versiunea lui Mainclain? :-?
"I will not be forgotten, this is my time to shine. I've got the scars to prove it, only the strong survive.
I'm not afraid of dying, everyone has their time. Life never favored weakness, welcome to the pride!"

[Image: large.gif]
replyReply
#5
(07-14-2014, 06:56 PM)Kalatas Wrote: Serverul comunitatii se va muta pe versiunea lui Mainclain? :-?

Nu, desi ar fi fost cateva beneficii destul de mari, precum cufere sincronizate (putem lua sau pune obiecte in cufere), usi, porti sincronizate, animatii etc. Doar ca versiunea noua este facuta doar pentru windows, iar hostul nostru este pe linux.
FlowerFlower
replyReply
#6
(07-14-2014, 06:54 PM)Dorel Wrote:
(07-14-2014, 06:53 PM)soul of darknes Wrote: Si asta inseamna ca ?
Mai pe intelesul nostru. Haha

Doar va prezentam noul Gothic Multiplayer.
Majoritatea nu intelege nimic din toate alea..
Deci, multe lucruri sincronizate, ce mai are in plus ?
replyReply
#7
Daca am putea interactiona cu mai multe obiecte in afara de plante ar fi superb . Smile
[Image: desc_rcare.jpg]
IGN:zHyuga
replyReply
#8
(07-14-2014, 08:15 PM)Zabuzz Wrote: Daca am putea interactiona cu mai multe obiecte in afara de plante ar fi superb . Smile

ar fi fost cateva beneficii destul de mari, precum cufere sincronizate (putem lua sau pune obiecte in cufere), usi, porti sincronizate, animatii
replyReply
#9
(07-14-2014, 08:18 PM)soul of darknes Wrote:
(07-14-2014, 08:15 PM)Zabuzz Wrote: Daca am putea interactiona cu mai multe obiecte in afara de plante ar fi superb . Smile

ar fi fost cateva beneficii destul de mari, precum cufere sincronizate (putem lua sau pune obiecte in cufere), usi, porti sincronizate, animatii

Am vazut asta dar zice Dorel ca e doar pt Windows...si host-ul e pe linux..
[Image: desc_rcare.jpg]
IGN:zHyuga
replyReply
#10
(07-14-2014, 08:11 PM)soul of darknes Wrote: Majoritatea nu intelege nimic din toate alea..
Deci, multe lucruri sincronizate, ce mai are in plus ?

Pai poti sa iti faci setarile video direct din multiplayer, nu mai e nevoie sa iesi si sa intri in single player pentru asta, modul de lupta e mai apropiat de single player decat cel actual, poti controla vremea (ma rog, adminii pot face asta) Grin, sistem de login-register mult mai tare, ai chiar si cursor cand iti faci cont.
Show Content
Poti face iteme direct de pe multiplayer, nu mai e nevoie de un vdf cu iteme cum avem noi. (desigur, de 3d-uri tot e nevoie). Scrolluri si rune (adica magiile) sunt sincronizate, etc.
FlowerFlower
replyReply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mai exista Gothic multyplayer ? ShadowZz 2 2,281 08-24-2016, 12:44 AM
Last Post: ShadowZz
  Intrebare server gothic Lukas1994 4 2,918 09-03-2014, 11:28 PM
Last Post: Edd
  Gothic multiplayer - discuții generale Szekemri 291 86,300 08-26-2014, 08:06 PM
Last Post: Szekemri
  Probleme conectare Gothic Multiplayer. Hydrax 100 37,811 08-17-2014, 09:39 PM
Last Post: Edd
  Gothic multiplayer 2014 - Tutorial instalare Szekemri 0 2,525 06-28-2014, 11:36 PM
Last Post: Szekemri

Forum Jump:


Users browsing this thread: 6 Guest(s)