public override void HandleRequest(Session.Receive request) { var session = request.ReadUInt32(); var ids = StaticChunkPool.Id; Reply.Send(request.Session, session, ids); }
public override void HandleRequest(Session.Receive stream) { var request = stream.ReadUInt32(); var world = ChunkService.Worlds.Get(stream.ReadUInt32()); var ret = new Dictionary <string, string> { { "name", world.Name } }; Reply.Send(stream.Session, request, ret); }
public override void HandleRequest(Session.Receive request) { var req = request.Read <int[]>(); var chunkPos = new Int3(req[1], req[2], req[3]); var world = ChunkService.Worlds.Get((uint)req[0]); ChunkService.TaskDispatcher.Add( new World.World.ResetChunkTask(RequestExtractChunkContent(request, chunkPos, world)) ); }
private static Chunk RequestExtractChunkContent(Session.Receive request, Int3 chunkPos, World.World world) { var cow = request.ReadUInt32(); if (cow != uint.MaxValue) { return(new Chunk(chunkPos, world, cow)); } var data = GetCache(); request.Read(data, 0, data.Length); return(DeserializeChunk(chunkPos, world, data)); }
public override void HandleRequest(Session.Receive stream) { var request = stream.Read <int[]>(); var chunk = GetChunk((uint)request[0], new Int3(request[1], request[2], request[3])); using (var message = stream.Session.CreateMessage(Id)) { message.WriteObject(request); var cow = chunk.CopyOnWrite; message.Write(cow); if (cow == uint.MaxValue) { var chunkData = Get(chunk); message.Write(chunkData, 0, chunkData.Length); } } }
public override void HandleRequest(Session.Receive request) { var session = request.ReadUInt32(); Reply.Send(request.Session, session, new uint[] { 0 }); }