using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; namespace GameDB { public static class WorldglobaldataDbOp { public static void OnWorldglobaldataDbOpReq(uint remoteAppID, StructPacket packet, GameDBOperator dbOperator) { ref SSWorldGlobalDataDBOpReq req = ref packet.GetMessage(); SSWorldGlobalDataDBOpRes res = new SSWorldGlobalDataDBOpRes(); res.OpType = req.OpType; res.DataType = req.DataType; res.GlobalId = req.GlobalId; res.DataVer = req.DataVer; switch (req.OpType) { case WorldGlobalDataDBOpType.Query: res.Ret = dbOperator.OnQueryWorldGlobalDataDBOp(ref req,ref res); break; case WorldGlobalDataDBOpType.Update: res.Ret = dbOperator.OnUpdateWorldGlobalDataDBOp(ref req, ref res); break; default: TraceLog.Error("WorldglobaldataDbOp.OnWorldglobaldataDbOpReq OpType error:{0}", req.OpType); return; } if (res.Ret == 0) { TraceLog.Trace("WorldglobaldataDbOp.OnWorldglobaldataDbOpReq success: playerid:{0}", packet.ObjectID); } else { TraceLog.Error("WorldglobaldataDbOp.OnWorldglobaldataDbOpReq error:{0} playerid:{1}", res.Ret, packet.ObjectID); } GameDBServerUtils.GetPacketSender().SendToServerByID(remoteAppID, (int)SSGameMsgID.WorldglobaldataDbOpRes, ref res, packet.ObjectID, packet.ServerID); } } }