Montag, 23. Dezember 2013

Universal Game Server SDK

following up to the previous post, I created a SDK for a universal gameserver. It will handle player authentication, stats, lobby chat and game listing. So f.e. an example game log into it and sees what other players and games are available. Once a hosting player starts a session, the other talk to him over p2p with the IP they got from this game server. The "protocol" are the packed variables from previous post. WIP and first stable version on SVN :D



here the example code for creating the test packet, convinient enough for me^^

public static void SendTestPacket()
        {            
            List<NetHelper.PackedVariable> l1 = new List<NetHelper.PackedVariable>();
            l1.Add(NetHelper.CreatePackedVar(1, -1)); 
            l1.Add(NetHelper.CreatePackedVar(2, (uint)0x1000)); 
            l1.Add(NetHelper.CreatePackedVar(3, 3.1415f));
            List<NetHelper.PackedVariable> l2 = new List<NetHelper.PackedVariable>();
            l2.Add(NetHelper.CreatePackedVar(5, l1));
            l2.Add(NetHelper.CreatePackedVar(4, "Hello World"));
            List<NetHelper.PackedVariable> l3 = new List<NetHelper.PackedVariable>();
            l3.Add(NetHelper.CreatePackedVar(5, l2));
            l3.Add(NetHelper.CreatePackedVar(2, (uint)0x1111));
            SendPacket(NetHelper.CreatePackedVar(5, l3));
            log.Write("GameClient : Test Packet Send", 5, Color.Blue);
        }


greetz WV

Keine Kommentare:

Kommentar veröffentlichen