World of Gothic - Forum
Gothic II Untold Chapter - Printable Version

+- World of Gothic - Forum (https://worldofgothic.ro/forum)
+-- Forum: The Colony (https://worldofgothic.ro/forum/forumdisplay.php?fid=4)
+--- Forum: Modding (https://worldofgothic.ro/forum/forumdisplay.php?fid=43)
+---- Forum: Gothic Multiplayer 2014 (https://worldofgothic.ro/forum/forumdisplay.php?fid=63)
+---- Thread: Gothic II Untold Chapter (/showthread.php?tid=5209)

Pages: 1 2 3 4 5


Gothic II Untold Chapter - Edd - 07-14-2014

[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>



RE: Gothic II Untold Chapter - soul of darkness - 07-14-2014

Si asta inseamna ca ?
Mai pe intelesul nostru. Haha


RE: Gothic II Untold Chapter - Edd - 07-14-2014

(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.


RE: Gothic II Untold Chapter - Kalatas - 07-14-2014

Serverul comunitatii se va muta pe versiunea lui Mainclain? :-?


RE: Gothic II Untold Chapter - Edd - 07-14-2014

(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.


RE: Gothic II Untold Chapter - soul of darkness - 07-14-2014

(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 ?


RE: Gothic II Untold Chapter - Zabuzz - 07-14-2014

Daca am putea interactiona cu mai multe obiecte in afara de plante ar fi superb . Smile


RE: Gothic II Untold Chapter - soul of darkness - 07-14-2014

(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


RE: Gothic II Untold Chapter - Zabuzz - 07-14-2014

(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..


RE: Gothic II Untold Chapter - Edd - 07-14-2014

(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.