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


Messages In This Thread
Gothic II Untold Chapter - by Edd - 07-14-2014, 06:51 PM
RE: Gothic II Untold Chapter - by Edd - 07-14-2014, 06:54 PM
RE: Gothic II Untold Chapter - by Edd - 07-14-2014, 09:17 PM
RE: Gothic II Untold Chapter - by Zabuzz - 07-14-2014, 10:10 PM
RE: Gothic II Untold Chapter - by Kalatas - 07-14-2014, 06:56 PM
RE: Gothic II Untold Chapter - by Edd - 07-14-2014, 07:00 PM
RE: Gothic II Untold Chapter - by Zabuzz - 07-14-2014, 08:15 PM
RE: Gothic II Untold Chapter - by Zabuzz - 07-14-2014, 08:22 PM
RE: Gothic II Untold Chapter - by Kalatas - 07-14-2014, 09:29 PM
RE: Gothic II Untold Chapter - by Cyrus35 - 07-15-2014, 10:52 AM
RE: Gothic II Untold Chapter - by cornel - 07-14-2014, 09:55 PM
RE: Gothic II Untold Chapter - by Kalatas - 07-14-2014, 09:56 PM
RE: Gothic II Untold Chapter - by Edd - 07-14-2014, 09:59 PM
RE: Gothic II Untold Chapter - by Hydrax - 07-14-2014, 11:27 PM
RE: Gothic II Untold Chapter - by Edd - 07-14-2014, 11:37 PM
RE: Gothic II Untold Chapter - by Cyrus35 - 07-15-2014, 12:27 AM
RE: Gothic II Untold Chapter - by Edd - 07-15-2014, 01:07 AM
RE: Gothic II Untold Chapter - by D13g0 - 07-15-2014, 10:55 AM
RE: Gothic II Untold Chapter - by Cyrus35 - 07-15-2014, 11:06 AM
RE: Gothic II Untold Chapter - by Edd - 07-15-2014, 11:27 AM
RE: Gothic II Untold Chapter - by cornel - 07-15-2014, 08:33 PM
RE: Gothic II Untold Chapter - by cornel - 07-15-2014, 09:34 PM
RE: Gothic II Untold Chapter - by Hydrax - 07-15-2014, 10:13 PM
RE: Gothic II Untold Chapter - by Szekemri - 07-16-2014, 12:06 AM
RE: Gothic II Untold Chapter - by Edd - 07-16-2014, 10:57 AM
RE: Gothic II Untold Chapter - by Zabuzz - 07-16-2014, 11:13 AM
RE: Gothic II Untold Chapter - by Edd - 07-17-2014, 02:47 AM
RE: Gothic II Untold Chapter - by Hydrax - 07-17-2014, 10:00 AM
RE: Gothic II Untold Chapter - by Edd - 07-17-2014, 10:45 AM
RE: Gothic II Untold Chapter - by Hydrax - 07-17-2014, 08:55 PM
RE: Gothic II Untold Chapter - by Edd - 07-17-2014, 08:59 PM
RE: Gothic II Untold Chapter - by Tibby - 08-02-2014, 03:42 PM
RE: Gothic II Untold Chapter - by Edd - 08-02-2014, 06:37 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)