public static byte[] HandleMessage(ClientInfo client, byte[] data, byte sessionID) { Log.WriteLine(1, "[DO] Handling DO_JoinRequestMessage..."); SendConnectionRequest(client, sessionID); List <byte[]> msgs = new List <byte[]>(); InitSession(client); DupObj clientStation = new DupObj(DupObjClass.Station, client.stationID, 1); Payload_Station ps = new Payload_Station(); ps.connectionInfo.m_strStationURL1 = "prudp:/address=255.0.0.0;port=4"; ps.stationState = STATIONSTATE.JoiningSession; clientStation.Payload = ps; DO_Session.DupObjs.Add(clientStation); msgs.Add(DO_JoinResponseMessage.Create(1, new DupObj(DupObjClass.Station, client.stationID, 1))); msgs.Add(DO_CreateAndPromoteDuplicaMessage.Create(client.callCounterDO_RMC++, clientStation, 2)); msgs.Add(DO_MigrationMessage.Create(client.callCounterDO_RMC++, new DupObj(DupObjClass.Station, 1), new DupObj(DupObjClass.Station, client.stationID), new DupObj(DupObjClass.Station, client.stationID), 3, new List <uint>())); clientStation.Master.ID = client.stationID; return(DO_BundleMessage.Create(client, msgs)); }
public static void ResetObjects() { DupObjs = new List <DupObj>(); Payload_Station ps = new Payload_Station(); ps.connectionInfo.m_bURLInitialized = 1; ps.connectionInfo.m_strStationURL1 = "prudp:/address=127.0.0.1;port=5004;RVCID=166202"; ps.connectionInfo.m_strStationURL2 = "prudp:/address=127.0.0.1;port=5004;sid=15;type=2;RVCID=166202"; ps.stationState = STATIONSTATE.Participating; DupObjs.Add(new DupObj(DupObjClass.Station, 1, 1, ps)); DupObjs.Add(new DupObj(DupObjClass.SessionClock, 1, 1)); DupObjs.Add(new DupObj(DupObjClass.SES_cl_SessionInfos, 2, 1, new Payload_SessionInfos())); DupObjs.Add(new DupObj(DupObjClass.PromotionReferee, 3, 1)); DupObjs.Add(new DupObj(DupObjClass.Session, 4, 1, new Payload_Session())); DupObjs.Add(new DupObj(DupObjClass.NET_MessageBroker, 5, 1)); uint[] IDGeneratorIDs = { 7, 0xD, 0x13, 0x14, 0x15, 0x16, 0x18, 0x1A, 0x23 }; foreach (uint id in IDGeneratorIDs) { DupObjs.Add(new DupObj(DupObjClass.IDGenerator, id, 1, new Payload_IDRange(0x1, 0x3FFFFE))); } DupObjs.Add(new DupObj(DupObjClass.IDGenerator, 0x17, 1, new Payload_IDRange(0x102, 0x3FFFFE))); DupObjs.Add(new DupObj(DupObjClass.IDGenerator, 0x19, 1, new Payload_IDRange(0x24, 0x3FFFFE))); }