diff --git a/Release/6.7.9.11/AccountServer/Console/AccountServerConsole.exe b/Release/6.7.10.0/AccountServer/Console/AccountServerConsole.exe similarity index 60% rename from Release/6.7.9.11/AccountServer/Console/AccountServerConsole.exe rename to Release/6.7.10.0/AccountServer/Console/AccountServerConsole.exe index 12d9e4e5..c952fa4f 100644 Binary files a/Release/6.7.9.11/AccountServer/Console/AccountServerConsole.exe and b/Release/6.7.10.0/AccountServer/Console/AccountServerConsole.exe differ diff --git a/Release/6.7.9.11/AccountServer/Console/AccountServerConsole.exe.config b/Release/6.7.10.0/AccountServer/Console/AccountServerConsole.exe.config similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/AccountServerConsole.exe.config rename to Release/6.7.10.0/AccountServer/Console/AccountServerConsole.exe.config diff --git a/Release/6.7.9.11/AccountServer/Console/Mono.Cecil.Pdb.dll b/Release/6.7.10.0/AccountServer/Console/Mono.Cecil.Pdb.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/Mono.Cecil.Pdb.dll rename to Release/6.7.10.0/AccountServer/Console/Mono.Cecil.Pdb.dll diff --git a/Release/6.7.9.11/AccountServer/Console/Mono.Cecil.dll b/Release/6.7.10.0/AccountServer/Console/Mono.Cecil.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/Mono.Cecil.dll rename to Release/6.7.10.0/AccountServer/Console/Mono.Cecil.dll diff --git a/Release/6.7.9.11/AccountServer/Console/MySql.Data.dll b/Release/6.7.10.0/AccountServer/Console/MySql.Data.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/MySql.Data.dll rename to Release/6.7.10.0/AccountServer/Console/MySql.Data.dll diff --git a/Release/6.7.9.11/AccountServer/Web/NLog.config b/Release/6.7.10.0/AccountServer/Console/NLog.config similarity index 94% rename from Release/6.7.9.11/AccountServer/Web/NLog.config rename to Release/6.7.10.0/AccountServer/Console/NLog.config index cc47dc98..043c8a75 100644 --- a/Release/6.7.9.11/AccountServer/Web/NLog.config +++ b/Release/6.7.10.0/AccountServer/Console/NLog.config @@ -1,11 +1,11 @@ - + - + diff --git a/Release/6.7.9.11/AccountServer/Console/NLog.dll b/Release/6.7.10.0/AccountServer/Console/NLog.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/NLog.dll rename to Release/6.7.10.0/AccountServer/Console/NLog.dll diff --git a/Release/6.7.9.11/AccountServer/Console/Newtonsoft.Json.dll b/Release/6.7.10.0/AccountServer/Console/Newtonsoft.Json.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/Newtonsoft.Json.dll rename to Release/6.7.10.0/AccountServer/Console/Newtonsoft.Json.dll diff --git a/Release/6.7.9.11/AccountServer/Console/ServiceStack.Redis.dll b/Release/6.7.10.0/AccountServer/Console/ServiceStack.Redis.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/ServiceStack.Redis.dll rename to Release/6.7.10.0/AccountServer/Console/ServiceStack.Redis.dll diff --git a/Release/6.7.9.11/AccountServer/Console/ServiceStack.Text.dll b/Release/6.7.10.0/AccountServer/Console/ServiceStack.Text.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/ServiceStack.Text.dll rename to Release/6.7.10.0/AccountServer/Console/ServiceStack.Text.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Common.dll b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Common.dll similarity index 99% rename from Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Common.dll rename to Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Common.dll index a691cc1c..c787f843 100644 Binary files a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Common.dll and b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Common.dll differ diff --git a/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Game.dll b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Game.dll new file mode 100644 index 00000000..662fd616 Binary files /dev/null and b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.Game.dll differ diff --git a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.dll b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.dll similarity index 64% rename from Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.dll rename to Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.dll index 5c574654..e6472fe4 100644 Binary files a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.dll and b/Release/6.7.10.0/AccountServer/Console/ZyGames.Framework.dll differ diff --git a/Release/6.7.9.11/AccountServer/Console/protobuf-net.dll b/Release/6.7.10.0/AccountServer/Console/protobuf-net.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/protobuf-net.dll rename to Release/6.7.10.0/AccountServer/Console/protobuf-net.dll diff --git a/Release/6.7.9.11/AccountServer/Web/Default.ashx b/Release/6.7.10.0/AccountServer/Web/Default.ashx similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/Default.ashx rename to Release/6.7.10.0/AccountServer/Web/Default.ashx diff --git a/Release/6.7.9.11/AccountServer/Web/Global.asax b/Release/6.7.10.0/AccountServer/Web/Global.asax similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/Global.asax rename to Release/6.7.10.0/AccountServer/Web/Global.asax diff --git a/Release/6.7.9.11/AccountServer/Console/NLog.config b/Release/6.7.10.0/AccountServer/Web/NLog.config similarity index 100% rename from Release/6.7.9.11/AccountServer/Console/NLog.config rename to Release/6.7.10.0/AccountServer/Web/NLog.config diff --git a/Release/6.7.9.11/AccountServer/Web/Web.config b/Release/6.7.10.0/AccountServer/Web/Web.config similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/Web.config rename to Release/6.7.10.0/AccountServer/Web/Web.config diff --git a/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.dll b/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.dll new file mode 100644 index 00000000..386e740b Binary files /dev/null and b/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.dll differ diff --git a/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.pdb b/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.pdb new file mode 100644 index 00000000..8eac37a6 Binary files /dev/null and b/Release/6.7.10.0/AccountServer/Web/bin/AccountServer.pdb differ diff --git a/Release/6.7.9.11/AccountServer/Web/bin/Mono.Cecil.Pdb.dll b/Release/6.7.10.0/AccountServer/Web/bin/Mono.Cecil.Pdb.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/Mono.Cecil.Pdb.dll rename to Release/6.7.10.0/AccountServer/Web/bin/Mono.Cecil.Pdb.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/Mono.Cecil.dll b/Release/6.7.10.0/AccountServer/Web/bin/Mono.Cecil.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/Mono.Cecil.dll rename to Release/6.7.10.0/AccountServer/Web/bin/Mono.Cecil.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/MySql.Data.dll b/Release/6.7.10.0/AccountServer/Web/bin/MySql.Data.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/MySql.Data.dll rename to Release/6.7.10.0/AccountServer/Web/bin/MySql.Data.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/NLog.dll b/Release/6.7.10.0/AccountServer/Web/bin/NLog.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/NLog.dll rename to Release/6.7.10.0/AccountServer/Web/bin/NLog.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/Newtonsoft.Json.dll b/Release/6.7.10.0/AccountServer/Web/bin/Newtonsoft.Json.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/Newtonsoft.Json.dll rename to Release/6.7.10.0/AccountServer/Web/bin/Newtonsoft.Json.dll diff --git a/Release/6.7.9.11/AccountServer/Web/bin/ServiceStack.Redis.dll b/Release/6.7.10.0/AccountServer/Web/bin/ServiceStack.Redis.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/ServiceStack.Redis.dll rename to Release/6.7.10.0/AccountServer/Web/bin/ServiceStack.Redis.dll diff --git a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Common.dll b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Common.dll similarity index 99% rename from Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Common.dll rename to Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Common.dll index a691cc1c..29c9b132 100644 Binary files a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Common.dll and b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Common.dll differ diff --git a/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Game.dll b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Game.dll new file mode 100644 index 00000000..beb41415 Binary files /dev/null and b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.Game.dll differ diff --git a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.dll b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.dll similarity index 64% rename from Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.dll rename to Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.dll index 5c574654..b1a72b90 100644 Binary files a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.dll and b/Release/6.7.10.0/AccountServer/Web/bin/ZyGames.Framework.dll differ diff --git a/Release/6.7.9.11/AccountServer/Web/bin/protobuf-net.dll b/Release/6.7.10.0/AccountServer/Web/bin/protobuf-net.dll similarity index 100% rename from Release/6.7.9.11/AccountServer/Web/bin/protobuf-net.dll rename to Release/6.7.10.0/AccountServer/Web/bin/protobuf-net.dll diff --git a/Release/6.7.10.0/Console/GameServer.exe b/Release/6.7.10.0/Console/GameServer.exe new file mode 100644 index 00000000..2632285a Binary files /dev/null and b/Release/6.7.10.0/Console/GameServer.exe differ diff --git a/Release/6.7.9.11/Console/GameServer.exe.config b/Release/6.7.10.0/Console/GameServer.exe.config similarity index 100% rename from Release/6.7.9.11/Console/GameServer.exe.config rename to Release/6.7.10.0/Console/GameServer.exe.config diff --git a/Release/6.7.9.11/Console/GameServer.pdb b/Release/6.7.10.0/Console/GameServer.pdb similarity index 84% rename from Release/6.7.9.11/Console/GameServer.pdb rename to Release/6.7.10.0/Console/GameServer.pdb index 189e958e..926a21f1 100644 Binary files a/Release/6.7.9.11/Console/GameServer.pdb and b/Release/6.7.10.0/Console/GameServer.pdb differ diff --git a/Release/6.7.9.11/Console/Install.bat b/Release/6.7.10.0/Console/Install.bat similarity index 100% rename from Release/6.7.9.11/Console/Install.bat rename to Release/6.7.10.0/Console/Install.bat diff --git a/Release/6.7.9.11/Console/NLog.config b/Release/6.7.10.0/Console/NLog.config similarity index 100% rename from Release/6.7.9.11/Console/NLog.config rename to Release/6.7.10.0/Console/NLog.config diff --git a/Release/6.7.9.11/Console/Script/CsScript/Action/Action1000.cs b/Release/6.7.10.0/Console/Script/CsScript/Action/Action1000.cs similarity index 100% rename from Release/6.7.9.11/Console/Script/CsScript/Action/Action1000.cs rename to Release/6.7.10.0/Console/Script/CsScript/Action/Action1000.cs diff --git a/Release/6.7.9.11/Console/Script/CsScript/Action/Action1001.cs b/Release/6.7.10.0/Console/Script/CsScript/Action/Action1001.cs similarity index 96% rename from Release/6.7.9.11/Console/Script/CsScript/Action/Action1001.cs rename to Release/6.7.10.0/Console/Script/CsScript/Action/Action1001.cs index 7d0954e7..f01046f0 100644 --- a/Release/6.7.9.11/Console/Script/CsScript/Action/Action1001.cs +++ b/Release/6.7.10.0/Console/Script/CsScript/Action/Action1001.cs @@ -53,7 +53,7 @@ public override void BuildPacket() { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.UserName); - dsItem.PushIntoStack(item.Score); + dsItem.PushIntoStack(item.Score); //Console.WriteLine("Num count:{0}", item.Items.Count); this.PushIntoStack(dsItem); } @@ -84,7 +84,7 @@ private int compareTo(UserRanking x, UserRanking y) int result = y.Score - x.Score; if (result == 0) { - result = y.UserID - x.UserID; + result = y.UserID.CompareTo(x.UserID); } return result; } diff --git a/Release/6.7.9.11/Console/Script/CsScript/Locale/SimplifiedLanguage.cs b/Release/6.7.10.0/Console/Script/CsScript/Locale/SimplifiedLanguage.cs similarity index 100% rename from Release/6.7.9.11/Console/Script/CsScript/Locale/SimplifiedLanguage.cs rename to Release/6.7.10.0/Console/Script/CsScript/Locale/SimplifiedLanguage.cs diff --git a/Release/6.7.9.11/Console/Script/CsScript/MainClass.cs b/Release/6.7.10.0/Console/Script/CsScript/MainClass.cs similarity index 100% rename from Release/6.7.9.11/Console/Script/CsScript/MainClass.cs rename to Release/6.7.10.0/Console/Script/CsScript/MainClass.cs diff --git a/Release/6.7.9.11/Console/Script/LuaScript/Action/Action1001.lua b/Release/6.7.10.0/Console/Script/LuaScript/Action/Action1001.lua similarity index 100% rename from Release/6.7.9.11/Console/Script/LuaScript/Action/Action1001.lua rename to Release/6.7.10.0/Console/Script/LuaScript/Action/Action1001.lua diff --git a/Release/6.7.9.11/Console/Script/Model/GuestUser.cs b/Release/6.7.10.0/Console/Script/Model/GuestUser.cs similarity index 94% rename from Release/6.7.9.11/Console/Script/Model/GuestUser.cs rename to Release/6.7.10.0/Console/Script/Model/GuestUser.cs index 578c70e2..6a8ae2f3 100644 --- a/Release/6.7.9.11/Console/Script/Model/GuestUser.cs +++ b/Release/6.7.10.0/Console/Script/Model/GuestUser.cs @@ -35,7 +35,7 @@ public class GameUser : BaseUser { [ProtoMember(1)] [EntityField(true)] - public int UserId { get; set; } + public long UserId { get; set; } [ProtoMember(2)] [EntityField] @@ -63,12 +63,12 @@ public String RetailId public string SId { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserId; } - - public override int GetUserId() + + public override long GetUserId() { return UserId; } diff --git a/Release/6.7.9.11/Console/Script/Model/UserRanking.cs b/Release/6.7.10.0/Console/Script/Model/UserRanking.cs similarity index 97% rename from Release/6.7.9.11/Console/Script/Model/UserRanking.cs rename to Release/6.7.10.0/Console/Script/Model/UserRanking.cs index 6d270625..516a5276 100644 --- a/Release/6.7.9.11/Console/Script/Model/UserRanking.cs +++ b/Release/6.7.10.0/Console/Script/Model/UserRanking.cs @@ -45,7 +45,7 @@ public UserRanking() [ProtoMember(1)] [EntityField(true)] - public int UserID + public long UserID { get; set; @@ -79,7 +79,7 @@ public DateTime CreateDate [EntityField] public CacheList Items { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserID; } diff --git a/Release/6.7.9.11/Console/ScutSMS Readme.chm b/Release/6.7.10.0/Console/ScutSMS Readme.chm similarity index 100% rename from Release/6.7.9.11/Console/ScutSMS Readme.chm rename to Release/6.7.10.0/Console/ScutSMS Readme.chm diff --git a/Release/6.7.9.11/Console/ScutSMS.exe b/Release/6.7.10.0/Console/ScutSMS.exe similarity index 73% rename from Release/6.7.9.11/Console/ScutSMS.exe rename to Release/6.7.10.0/Console/ScutSMS.exe index 56a213ca..dcf78d10 100644 Binary files a/Release/6.7.9.11/Console/ScutSMS.exe and b/Release/6.7.10.0/Console/ScutSMS.exe differ diff --git a/Release/6.7.9.11/Install/SCUTServerSetup(x86).iss b/Release/6.7.10.0/Install/SCUTServerSetup(x86).iss similarity index 100% rename from Release/6.7.9.11/Install/SCUTServerSetup(x86).iss rename to Release/6.7.10.0/Install/SCUTServerSetup(x86).iss diff --git a/Release/6.7.9.11/Install/SCUTServerSetup.iss b/Release/6.7.10.0/Install/SCUTServerSetup.iss similarity index 100% rename from Release/6.7.9.11/Install/SCUTServerSetup.iss rename to Release/6.7.10.0/Install/SCUTServerSetup.iss diff --git a/Release/6.7.9.11/Install/scut36.ico b/Release/6.7.10.0/Install/scut36.ico similarity index 100% rename from Release/6.7.9.11/Install/scut36.ico rename to Release/6.7.10.0/Install/scut36.ico diff --git a/Release/6.7.9.11/Lib/ICSharpCode.SharpZipLib.dll b/Release/6.7.10.0/Lib/ICSharpCode.SharpZipLib.dll similarity index 100% rename from Release/6.7.9.11/Lib/ICSharpCode.SharpZipLib.dll rename to Release/6.7.10.0/Lib/ICSharpCode.SharpZipLib.dll diff --git a/Release/6.7.9.11/Lib/IronPython.Modules.dll b/Release/6.7.10.0/Lib/IronPython.Modules.dll similarity index 100% rename from Release/6.7.9.11/Lib/IronPython.Modules.dll rename to Release/6.7.10.0/Lib/IronPython.Modules.dll diff --git a/Release/6.7.9.11/Lib/IronPython.dll b/Release/6.7.10.0/Lib/IronPython.dll similarity index 100% rename from Release/6.7.9.11/Lib/IronPython.dll rename to Release/6.7.10.0/Lib/IronPython.dll diff --git a/Release/6.7.9.11/Lib/KopiLua.dll b/Release/6.7.10.0/Lib/KopiLua.dll similarity index 100% rename from Release/6.7.9.11/Lib/KopiLua.dll rename to Release/6.7.10.0/Lib/KopiLua.dll diff --git a/Release/6.7.9.11/Lib/Microsoft.Dynamic.dll b/Release/6.7.10.0/Lib/Microsoft.Dynamic.dll similarity index 100% rename from Release/6.7.9.11/Lib/Microsoft.Dynamic.dll rename to Release/6.7.10.0/Lib/Microsoft.Dynamic.dll diff --git a/Release/6.7.9.11/Lib/Microsoft.Scripting.dll b/Release/6.7.10.0/Lib/Microsoft.Scripting.dll similarity index 100% rename from Release/6.7.9.11/Lib/Microsoft.Scripting.dll rename to Release/6.7.10.0/Lib/Microsoft.Scripting.dll diff --git a/Release/6.7.9.11/Lib/Mono.Cecil.Mdb.dll b/Release/6.7.10.0/Lib/Mono.Cecil.Mdb.dll similarity index 100% rename from Release/6.7.9.11/Lib/Mono.Cecil.Mdb.dll rename to Release/6.7.10.0/Lib/Mono.Cecil.Mdb.dll diff --git a/Release/6.7.9.11/Lib/Mono.Cecil.Pdb.dll b/Release/6.7.10.0/Lib/Mono.Cecil.Pdb.dll similarity index 100% rename from Release/6.7.9.11/Lib/Mono.Cecil.Pdb.dll rename to Release/6.7.10.0/Lib/Mono.Cecil.Pdb.dll diff --git a/Release/6.7.9.11/Lib/Mono.Cecil.dll b/Release/6.7.10.0/Lib/Mono.Cecil.dll similarity index 100% rename from Release/6.7.9.11/Lib/Mono.Cecil.dll rename to Release/6.7.10.0/Lib/Mono.Cecil.dll diff --git a/Release/6.7.9.11/Lib/MySql.Data.dll b/Release/6.7.10.0/Lib/MySql.Data.dll similarity index 100% rename from Release/6.7.9.11/Lib/MySql.Data.dll rename to Release/6.7.10.0/Lib/MySql.Data.dll diff --git a/Release/6.7.9.11/Lib/NLog.dll b/Release/6.7.10.0/Lib/NLog.dll similarity index 100% rename from Release/6.7.9.11/Lib/NLog.dll rename to Release/6.7.10.0/Lib/NLog.dll diff --git a/Release/6.7.9.11/Lib/NLua.dll b/Release/6.7.10.0/Lib/NLua.dll similarity index 100% rename from Release/6.7.9.11/Lib/NLua.dll rename to Release/6.7.10.0/Lib/NLua.dll diff --git a/Release/6.7.9.11/Lib/Newtonsoft.Json.dll b/Release/6.7.10.0/Lib/Newtonsoft.Json.dll similarity index 100% rename from Release/6.7.9.11/Lib/Newtonsoft.Json.dll rename to Release/6.7.10.0/Lib/Newtonsoft.Json.dll diff --git a/Release/6.7.9.11/Lib/ScutSecurity.dll b/Release/6.7.10.0/Lib/ScutSecurity.dll similarity index 100% rename from Release/6.7.9.11/Lib/ScutSecurity.dll rename to Release/6.7.10.0/Lib/ScutSecurity.dll diff --git a/Release/6.7.9.11/Lib/ServiceStack.Common.dll b/Release/6.7.10.0/Lib/ServiceStack.Common.dll similarity index 100% rename from Release/6.7.9.11/Lib/ServiceStack.Common.dll rename to Release/6.7.10.0/Lib/ServiceStack.Common.dll diff --git a/Release/6.7.9.11/Lib/ServiceStack.Interfaces.dll b/Release/6.7.10.0/Lib/ServiceStack.Interfaces.dll similarity index 100% rename from Release/6.7.9.11/Lib/ServiceStack.Interfaces.dll rename to Release/6.7.10.0/Lib/ServiceStack.Interfaces.dll diff --git a/Release/6.7.9.11/Lib/ServiceStack.Redis.dll b/Release/6.7.10.0/Lib/ServiceStack.Redis.dll similarity index 100% rename from Release/6.7.9.11/Lib/ServiceStack.Redis.dll rename to Release/6.7.10.0/Lib/ServiceStack.Redis.dll diff --git a/Release/6.7.9.11/Lib/ServiceStack.Text.dll b/Release/6.7.10.0/Lib/ServiceStack.Text.dll similarity index 100% rename from Release/6.7.9.11/Lib/ServiceStack.Text.dll rename to Release/6.7.10.0/Lib/ServiceStack.Text.dll diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Common.dll b/Release/6.7.10.0/Lib/ZyGames.Framework.Common.dll similarity index 99% rename from Release/6.7.9.11/Lib/ZyGames.Framework.Common.dll rename to Release/6.7.10.0/Lib/ZyGames.Framework.Common.dll index a691cc1c..c787f843 100644 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.Common.dll and b/Release/6.7.10.0/Lib/ZyGames.Framework.Common.dll differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Common.pdb b/Release/6.7.10.0/Lib/ZyGames.Framework.Common.pdb similarity index 71% rename from Release/6.7.9.11/Lib/ZyGames.Framework.Common.pdb rename to Release/6.7.10.0/Lib/ZyGames.Framework.Common.pdb index f85cebae..95b24ce0 100644 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.Common.pdb and b/Release/6.7.10.0/Lib/ZyGames.Framework.Common.pdb differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Common.xml b/Release/6.7.10.0/Lib/ZyGames.Framework.Common.xml similarity index 100% rename from Release/6.7.9.11/Lib/ZyGames.Framework.Common.xml rename to Release/6.7.10.0/Lib/ZyGames.Framework.Common.xml diff --git a/Release/6.7.10.0/Lib/ZyGames.Framework.Game.dll b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.dll new file mode 100644 index 00000000..662fd616 Binary files /dev/null and b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.dll differ diff --git a/Release/6.7.10.0/Lib/ZyGames.Framework.Game.pdb b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.pdb new file mode 100644 index 00000000..d88f3753 Binary files /dev/null and b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.pdb differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.xml b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.xml similarity index 99% rename from Release/6.7.9.11/Lib/ZyGames.Framework.Game.xml rename to Release/6.7.10.0/Lib/ZyGames.Framework.Game.xml index 6929bc11..e29753fb 100644 --- a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.xml +++ b/Release/6.7.10.0/Lib/ZyGames.Framework.Game.xml @@ -174,21 +174,21 @@ - + - + - + @@ -461,7 +461,7 @@ The user identifier. - + @@ -588,7 +588,7 @@ The cache set. - + @@ -620,7 +620,7 @@ The user identifier. - + @@ -1185,14 +1185,14 @@ Create ip. Card no. - + 激活 - + Dos the activate. @@ -1200,7 +1200,7 @@ Card no. Gift type. - + 是否已激活 @@ -1329,7 +1329,7 @@ The length of the card. - + Initializes a new instance of the class. @@ -1359,7 +1359,7 @@ - + Dos the activate card. @@ -1372,7 +1372,7 @@ 领取奖励 - + Dos the prize. @@ -1494,7 +1494,7 @@ - + @@ -3566,6 +3566,14 @@ + + + + + + + + @@ -4520,6 +4528,14 @@ + + + 授权用户 + + + + + @@ -4537,12 +4553,12 @@ - + Dos the success. true, if success was done, false otherwise. - User identifier. + User identifier. @@ -5020,7 +5036,7 @@ - + Get session by userid @@ -5553,7 +5569,7 @@ init - + init @@ -6849,7 +6865,7 @@ 聊天服务 - + Initializes a new instance of the class. @@ -6886,7 +6902,7 @@ The receive. - + Users the receive. @@ -11306,7 +11322,7 @@ The user identifier. - + diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.XML b/Release/6.7.10.0/Lib/ZyGames.Framework.XML similarity index 99% rename from Release/6.7.9.11/Lib/ZyGames.Framework.XML rename to Release/6.7.10.0/Lib/ZyGames.Framework.XML index c7a6ee60..50ba988c 100644 --- a/Release/6.7.9.11/Lib/ZyGames.Framework.XML +++ b/Release/6.7.10.0/Lib/ZyGames.Framework.XML @@ -5610,7 +5610,7 @@ - + 写入消息队列 @@ -5620,7 +5620,7 @@ - + @@ -5631,7 +5631,7 @@ - + 生成Sql命令对象 @@ -6107,7 +6107,7 @@ - + @@ -6118,7 +6118,7 @@ - + @@ -6464,7 +6464,7 @@ - + Sql process queue @@ -6534,7 +6534,7 @@ - + @@ -6545,7 +6545,7 @@ - + diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.dll b/Release/6.7.10.0/Lib/ZyGames.Framework.dll similarity index 64% rename from Release/6.7.9.11/Lib/ZyGames.Framework.dll rename to Release/6.7.10.0/Lib/ZyGames.Framework.dll index 5c574654..e6472fe4 100644 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.dll and b/Release/6.7.10.0/Lib/ZyGames.Framework.dll differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.pdb b/Release/6.7.10.0/Lib/ZyGames.Framework.pdb similarity index 56% rename from Release/6.7.9.11/Lib/ZyGames.Framework.pdb rename to Release/6.7.10.0/Lib/ZyGames.Framework.pdb index 988d5447..845d798c 100644 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.pdb and b/Release/6.7.10.0/Lib/ZyGames.Framework.pdb differ diff --git a/Release/6.7.9.11/Lib/protobuf-net.dll b/Release/6.7.10.0/Lib/protobuf-net.dll similarity index 100% rename from Release/6.7.9.11/Lib/protobuf-net.dll rename to Release/6.7.10.0/Lib/protobuf-net.dll diff --git a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Game.dll b/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Game.dll deleted file mode 100644 index 89f0c112..00000000 Binary files a/Release/6.7.9.11/AccountServer/Console/ZyGames.Framework.Game.dll and /dev/null differ diff --git a/Release/6.7.9.11/AccountServer/Web/bin/AccountServer.dll b/Release/6.7.9.11/AccountServer/Web/bin/AccountServer.dll deleted file mode 100644 index 6eabf71a..00000000 Binary files a/Release/6.7.9.11/AccountServer/Web/bin/AccountServer.dll and /dev/null differ diff --git a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Game.dll b/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Game.dll deleted file mode 100644 index 89f0c112..00000000 Binary files a/Release/6.7.9.11/AccountServer/Web/bin/ZyGames.Framework.Game.dll and /dev/null differ diff --git a/Release/6.7.9.11/Console/GameServer.exe b/Release/6.7.9.11/Console/GameServer.exe deleted file mode 100644 index 99d1f7cc..00000000 Binary files a/Release/6.7.9.11/Console/GameServer.exe and /dev/null differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.dll b/Release/6.7.9.11/Lib/ZyGames.Framework.Game.dll deleted file mode 100644 index 89f0c112..00000000 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.dll and /dev/null differ diff --git a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.pdb b/Release/6.7.9.11/Lib/ZyGames.Framework.Game.pdb deleted file mode 100644 index ba70fba6..00000000 Binary files a/Release/6.7.9.11/Lib/ZyGames.Framework.Game.pdb and /dev/null differ diff --git a/Release/readme.md b/Release/readme.md index 58ae8563..971061b0 100644 --- a/Release/readme.md +++ b/Release/readme.md @@ -6,6 +6,6 @@ Release ----------------
  • PythonLib: A library of Python scripts -
  • 6.7.9.11: Is the latest R1 version of the library Scut Server +
  • 6.7.9.10: Is the latest R1 version of the library Scut Server
Old versions of libraries need to http://scutgame.com/download/ diff --git a/SDK/ScutSDK/LuaScut.cpp b/SDK/ScutSDK/LuaScut.cpp index e5300b60..d9b7e4b3 100644 --- a/SDK/ScutSDK/LuaScut.cpp +++ b/SDK/ScutSDK/LuaScut.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: Scut -** Generated automatically by tolua++-1.0.92 on 12/18/13 22:27:25. +** Generated automatically by tolua++-1.0.92 on 11/23/15 12:52:16. */ #ifndef __cplusplus @@ -32,9 +32,6 @@ TOLUA_API int tolua_Scut_open (lua_State* tolua_S); #include "ScutDataLogic/NetHelper.h" #include "ScutDataLogic/LuaString.h" #include "ScutDataLogic/Int64.h" -//#include"../FileHelper.h" -//#include"../LuaIni.h" -//#include"../LuaString.h" #include"DataRequest.h" #include "NetStreamExport.h" #include "ScutSystem/Defines.h" @@ -1078,6 +1075,38 @@ static int tolua_Scut_ScutDataLogic_CNetWriter_setStime00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* method: getTag of class ScutDataLogic::CNetWriter */ +#ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CNetWriter_getTag00 +static int tolua_Scut_ScutDataLogic_CNetWriter_getTag00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"ScutDataLogic::CNetWriter",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + ScutDataLogic::CNetWriter* self = (ScutDataLogic::CNetWriter*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getTag'", NULL); +#endif + { + int tolua_ret = (int) self->getTag(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'getTag'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: delete of class ScutDataLogic::CNetReader */ #ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CNetReader_delete00 static int tolua_Scut_ScutDataLogic_CNetReader_delete00(lua_State* tolua_S) @@ -2237,6 +2266,37 @@ static int tolua_Scut_ScutDataLogic_CDataRequest_Instance00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* method: disconnect of class ScutDataLogic::CDataRequest */ +#ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CDataRequest_disconnect00 +static int tolua_Scut_ScutDataLogic_CDataRequest_disconnect00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"ScutDataLogic::CDataRequest",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + ScutDataLogic::CDataRequest* self = (ScutDataLogic::CDataRequest*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'disconnect'", NULL); +#endif + { + self->disconnect(); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'disconnect'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: ExecRequest of class ScutDataLogic::CDataRequest */ #ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CDataRequest_ExecRequest00 static int tolua_Scut_ScutDataLogic_CDataRequest_ExecRequest00(lua_State* tolua_S) @@ -2503,6 +2563,42 @@ static int tolua_Scut_ScutDataLogic_CNetStreamExport_recordEnd00(lua_State* tolu } #endif //#ifndef TOLUA_DISABLE +/* method: pushNetStream of class ScutDataLogic::CNetStreamExport */ +#ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CNetStreamExport_pushNetStream00 +static int tolua_Scut_ScutDataLogic_CNetStreamExport_pushNetStream00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"ScutDataLogic::CNetStreamExport",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + ScutDataLogic::CNetStreamExport* self = (ScutDataLogic::CNetStreamExport*) tolua_tousertype(tolua_S,1,0); + char* pdataStream = ((char*) tolua_tostring(tolua_S,2,0)); + int wSize = ((int) tolua_tonumber(tolua_S,3,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'pushNetStream'", NULL); +#endif + { + bool tolua_ret = (bool) self->pushNetStream(pdataStream,wSize); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'pushNetStream'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: getBYTE of class ScutDataLogic::CNetStreamExport */ #ifndef TOLUA_DISABLE_tolua_Scut_ScutDataLogic_CNetStreamExport_getBYTE00 static int tolua_Scut_ScutDataLogic_CNetStreamExport_getBYTE00(lua_State* tolua_S) @@ -10301,6 +10397,7 @@ TOLUA_API int tolua_Scut_open (lua_State* tolua_S) tolua_function(tolua_S,"setSessionID",tolua_Scut_ScutDataLogic_CNetWriter_setSessionID00); tolua_function(tolua_S,"setUserID",tolua_Scut_ScutDataLogic_CNetWriter_setUserID00); tolua_function(tolua_S,"setStime",tolua_Scut_ScutDataLogic_CNetWriter_setStime00); + tolua_function(tolua_S,"getTag",tolua_Scut_ScutDataLogic_CNetWriter_getTag00); tolua_endmodule(tolua_S); #ifdef __cplusplus tolua_cclass(tolua_S,"CNetReader","ScutDataLogic::CNetReader","ScutDataLogic::CNetStreamExport",tolua_collect_ScutDataLogic__CNetReader); @@ -10369,6 +10466,7 @@ TOLUA_API int tolua_Scut_open (lua_State* tolua_S) tolua_cclass(tolua_S,"CDataRequest","ScutDataLogic::CDataRequest","INetStatusNotify",NULL); tolua_beginmodule(tolua_S,"CDataRequest"); tolua_function(tolua_S,"Instance",tolua_Scut_ScutDataLogic_CDataRequest_Instance00); + tolua_function(tolua_S,"disconnect",tolua_Scut_ScutDataLogic_CDataRequest_disconnect00); tolua_function(tolua_S,"ExecRequest",tolua_Scut_ScutDataLogic_CDataRequest_ExecRequest00); tolua_function(tolua_S,"AsyncExecRequest",tolua_Scut_ScutDataLogic_CDataRequest_AsyncExecRequest00); tolua_function(tolua_S,"AsyncExecTcpRequest",tolua_Scut_ScutDataLogic_CDataRequest_AsyncExecTcpRequest00); @@ -10382,6 +10480,7 @@ TOLUA_API int tolua_Scut_open (lua_State* tolua_S) tolua_beginmodule(tolua_S,"CNetStreamExport"); tolua_function(tolua_S,"recordBegin",tolua_Scut_ScutDataLogic_CNetStreamExport_recordBegin00); tolua_function(tolua_S,"recordEnd",tolua_Scut_ScutDataLogic_CNetStreamExport_recordEnd00); + tolua_function(tolua_S,"pushNetStream",tolua_Scut_ScutDataLogic_CNetStreamExport_pushNetStream00); tolua_function(tolua_S,"getBYTE",tolua_Scut_ScutDataLogic_CNetStreamExport_getBYTE00); tolua_function(tolua_S,"getWORD",tolua_Scut_ScutDataLogic_CNetStreamExport_getWORD00); tolua_function(tolua_S,"getDWORD",tolua_Scut_ScutDataLogic_CNetStreamExport_getDWORD00); diff --git a/SDK/ScutSDK/ScutDataLogic/DataRequest.cpp b/SDK/ScutSDK/ScutDataLogic/DataRequest.cpp index bbdef9be..7a9ac98b 100644 --- a/SDK/ScutSDK/ScutDataLogic/DataRequest.cpp +++ b/SDK/ScutSDK/ScutDataLogic/DataRequest.cpp @@ -294,13 +294,17 @@ DWORD ScutDataLogic::CDataRequest::AsyncExecTcpRequest(CDataHandler* pHandler, i HttpResponse->SetTarget(new CMemoryStream()); HttpResponse->SetSendData(lpSendData, nDataLen + 4); - int nMsgid = CNetWriter::getTag(); + int nMsgid = CNetWriter::getInstance()->getTag(); //ִ첽 //if (pTcpClient->AsyncNetGet(lpszUrl, HttpResponse) == 0) //{ // dwRet = (DWORD)0; //} int nResult = pTcpClient->TcpGet(lpszUrl, *HttpResponse); + /*printf("AsyncTcpGet %d\n",GetTickCount()); + int nResult = pTcpClient->AsyncTcpGet(lpszUrl, HttpResponse); + printf("tcpget result%dʱ%d\n",nResult,GetTickCount());*/ + if (nResult == 0) { CTcpSceneManager::getInstance()->push(nMsgid, nTag, pScene); @@ -450,6 +454,12 @@ void ScutDataLogic::CDataRequest::OnNotify( PAsyncInfo pAi ) } } +//wangsheng +void ScutDataLogic::CDataRequest::disconnect() +{ + ScutNetwork::CTcpSceneManager::getInstance()->disconnect(); +} + void ScutDataLogic::CDataRequest::LuaHandleData(void* pScene, int nTag, int nNetRet, CStream* lpData, LPVOID lpExternal ) { //ScutLog("LuaHandleData nTag:%d", nTag); @@ -458,35 +468,37 @@ void ScutDataLogic::CDataRequest::LuaHandleData(void* pScene, int nTag, int nNet (*m_pLuaDataHandleCallBack)(pScene, nTag, nNetRet, lpData, lpExternal); } - lua_State* pState = LuaHost::Instance()->GetLuaState(); - lua_getglobal(pState, "OnHandleData"); - CC_ASSERT( lua_isfunction(pState, -1) && "OnHandleData is not a function"); + LuaHandlePushData(lpData); - lua_pushlightuserdata(pState, pScene); - lua_pushnumber(pState, nTag); - lua_pushnumber(pState, nNetRet); - lua_pushnumber(pState, int(lpData)); - lua_pushnumber(pState, int(lpExternal)); + //lua_State* pState = LuaHost::Instance()->GetLuaState(); + //lua_getglobal(pState, "OnHandleData"); + //CC_ASSERT( lua_isfunction(pState, -1) && "OnHandleData is not a function"); - int nargs = 5; - int traceback = 0; - lua_getglobal(pState, "__G__TRACKBACK__"); /* L: ... func arg1 arg2 ... G */ - if (!lua_isfunction(pState, -1)) - { - lua_pop(pState, 1); /* L: ... func arg1 arg2 ... */ - } - else - { - traceback = -nargs-2; - lua_insert(pState, traceback); /* L: ... G func arg1 arg2 ... */ - } + //lua_pushlightuserdata(pState, pScene); + //lua_pushnumber(pState, nTag); + //lua_pushnumber(pState, nNetRet); + //lua_pushnumber(pState, int(lpData)); + //lua_pushnumber(pState, int(lpExternal)); - if (lua_pcall(pState, nargs, 0, traceback) != 0) - { - l_error(pState, "Call lua OnHandlerData failed: %s", lua_tostring(pState, -1)); - } + //int nargs = 5; + //int traceback = 0; + //lua_getglobal(pState, "__G__TRACKBACK__"); /* L: ... func arg1 arg2 ... G */ + //if (!lua_isfunction(pState, -1)) + //{ + // lua_pop(pState, 1); /* L: ... func arg1 arg2 ... */ + //} + //else + //{ + // traceback = -nargs-2; + // lua_insert(pState, traceback); /* L: ... G func arg1 arg2 ... */ + //} + + //if (lua_pcall(pState, nargs, 0, traceback) != 0) + //{ + // l_error(pState, "Call lua OnHandlerData failed: %s", lua_tostring(pState, -1)); + //} - lua_pop(pState, (traceback != 0) ? 2 : 1); + //lua_pop(pState, (traceback != 0) ? 2 : 1); } bool ScutDataLogic::CDataRequest::LuaHandlePushData( CStream* lpData ) diff --git a/SDK/ScutSDK/ScutDataLogic/DataRequest.h b/SDK/ScutSDK/ScutDataLogic/DataRequest.h index 539d7bbc..1710a168 100644 --- a/SDK/ScutSDK/ScutDataLogic/DataRequest.h +++ b/SDK/ScutSDK/ScutDataLogic/DataRequest.h @@ -114,6 +114,9 @@ namespace ScutDataLogic bool GetUseKeepAliveMode(); virtual void OnNotify(PAsyncInfo pAi); + + //wangsheng + void disconnect(); private: void ProcAsyncInfo(PAsyncInfo pAi); void FreeRequestInfo(PRequestInfo pRi); diff --git a/SDK/ScutSDK/ScutDataLogic/LuaHost.cpp b/SDK/ScutSDK/ScutDataLogic/LuaHost.cpp index a18003e7..5ff9e8cd 100644 --- a/SDK/ScutSDK/ScutDataLogic/LuaHost.cpp +++ b/SDK/ScutSDK/ScutDataLogic/LuaHost.cpp @@ -191,7 +191,7 @@ bool ScutDataLogic::LuaHost::execFunc(const std::string & strFunc, void* pScene, if (lpData) { - int nTemp = (int)(int*)lpData; + int nTemp = (uintptr_t)(int*)lpData; tolua_pushnumber(m_pLuaState, nTemp); error = Scutlua_pcall(m_pLuaState,3,0); } diff --git a/SDK/ScutSDK/ScutDataLogic/NetHelper.h b/SDK/ScutSDK/ScutDataLogic/NetHelper.h index 743cf0a0..918bcbd2 100644 --- a/SDK/ScutSDK/ScutDataLogic/NetHelper.h +++ b/SDK/ScutSDK/ScutDataLogic/NetHelper.h @@ -51,7 +51,7 @@ namespace ScutDataLogic static void setSessionID(const char* pszSessionID); static void setUserID(CInt64 value); static void setStime(const char* pszTime); - static int getTag(); + int getTag(); private: static CNetWriter* instance; CNetWriter(void); diff --git a/SDK/ScutSDK/ScutExt.h b/SDK/ScutSDK/ScutExt.h index 47bd9ba6..9653f239 100644 --- a/SDK/ScutSDK/ScutExt.h +++ b/SDK/ScutSDK/ScutExt.h @@ -22,6 +22,8 @@ class ScutExt static const std::string& getResRootDir(); static ScutExt* getInstance(); + + /** Pauses the running scene for lua */ void RegisterPauseHandler(const char* pszFuncName); diff --git a/SDK/ScutSDK/ScutNetwork/TcpClient.cpp b/SDK/ScutSDK/ScutNetwork/TcpClient.cpp index d79e8799..d82a1597 100644 --- a/SDK/ScutSDK/ScutNetwork/TcpClient.cpp +++ b/SDK/ScutSDK/ScutNetwork/TcpClient.cpp @@ -61,6 +61,7 @@ using namespace ScutDataLogic; using namespace std; static int s_nSocket = 0; +static std::string s_Url = ""; CThreadMutex m_sSendThreadMutex; class TcpCurlHandlePool { @@ -92,7 +93,7 @@ class TcpCurlHandlePool if (handle) { curl_easy_cleanup(handle); - if ((unsigned int)this->GetHandle() == (unsigned int)handle) + if ((unsigned long)this->GetHandle() == (unsigned long)handle) { ret = NULL; } @@ -123,7 +124,7 @@ CTcpClient::CTcpClient() m_bIsBusy = false; m_bUseProgressReport = false; m_bAsyncProcessing = false; - m_nTimeOut = 30; //Ĭ30sʱ + m_nTimeOut = 10; //Ĭ30sʱ m_pNetNotify = NULL; m_nSocket = 0; } @@ -231,6 +232,16 @@ int CTcpClient::DoGetInternal(const char *url, CHttpClientResponse &resp) size_t ret_len; size_t new_size; + if (strcmp(s_Url.c_str(),url)!=0 && s_nSocket != 0) + { + printf("create new connect%s\n",url); + /*if (curl_handle != NULL) + { + ScutNetwork::CTcpClient::FreeCurlHandler(curl_handle); + }*/ + ScutNetwork::CTcpClient::FreeCurlHandler(curl_handle); + CTcpSceneManager::getInstance()->release(); + } //ϴεӲͬ if (s_nSocket == 0) { @@ -260,10 +271,13 @@ int CTcpClient::DoGetInternal(const char *url, CHttpClientResponse &resp) curl_easy_setopt(curl_handle, CURLOPT_PROGRESSDATA, this); }*/ + //printf("curl_easy_perform %d\n",GetTickCount()); res = curl_easy_perform(curl_handle); + //printf("curl_easy_perform %dʱ%d\n",res,GetTickCount()); if(res != CURLE_OK){ return ScutNetwork::aisFailed; } + s_Url = url; } else { @@ -480,6 +494,9 @@ int ScutNetwork::CTcpClient::TcpGet(const char* url, CHttpClientResponse &resp) { if ((nRet = DoGetInternal(url, resp)) == 0) { + }else + { + printf("tcpӴ\n"); } //FullReset(); /*#ifdef SCUT_WIN32 @@ -654,8 +671,10 @@ void ScutNetwork::CTcpClient::FreeCurlHandler(CURL* curl_handle) { AUTO_GUARD(m_sSendThreadMutex); s_nSocket = 0; + s_Url = ""; if (curl_handle) { TcpCurlHandlePool::Instance()->FreeHandle(curl_handle); + curl_handle = NULL; } } diff --git a/SDK/ScutSDK/ScutNetwork/TcpSceneManager.cpp b/SDK/ScutSDK/ScutNetwork/TcpSceneManager.cpp index 699800b4..ac976c60 100644 --- a/SDK/ScutSDK/ScutNetwork/TcpSceneManager.cpp +++ b/SDK/ScutSDK/ScutNetwork/TcpSceneManager.cpp @@ -195,6 +195,7 @@ namespace ScutNetwork if (s_ThreadExit) { ScutNetwork::CTcpClient::FreeCurlHandler(pTcpSceneManager->curl_handle); + pTcpSceneManager->release(); break; } @@ -220,8 +221,10 @@ namespace ScutNetwork } //֪ͨҵʧ ScutNetwork::CTcpClient::FreeCurlHandler(pTcpSceneManager->curl_handle); - delete pTcpSceneManager; - instance = NULL; + pTcpSceneManager->release(); + //wangsheng + /*delete pTcpSceneManager; + instance = NULL;*/ break; } @@ -269,6 +272,19 @@ namespace ScutNetwork asyncInfo.Response = NULL; } } + }else if (res == CURLE_RECV_ERROR) + { + if (pTcpSceneManager->m_pNetNotify) + { + AsyncInfo asyncInfo; + asyncInfo.ProtocalType = 1; + asyncInfo.Status = aisFailed; + asyncInfo.Data1 = -1; + pTcpSceneManager->m_pNetNotify->OnNotify(&asyncInfo); + } + //֪ͨҵʧ + ScutNetwork::CTcpClient::FreeCurlHandler(pTcpSceneManager->curl_handle); + pTcpSceneManager->release(); } memset(temp, 0, RECV_BUF_SIZE); nTotalLen = 0; @@ -348,7 +364,12 @@ namespace ScutNetwork return dw; } - + void CTcpSceneManager::disconnect() + { + //printf("disconnect"); + ScutNetwork::CTcpClient::FreeCurlHandler(curl_handle); + release(); + } void CTcpSceneManager::release() { curl_handle = NULL; diff --git a/SDK/ScutSDK/ScutNetwork/TcpSceneManager.h b/SDK/ScutSDK/ScutNetwork/TcpSceneManager.h index 06a49e17..a84d5a9f 100644 --- a/SDK/ScutSDK/ScutNetwork/TcpSceneManager.h +++ b/SDK/ScutSDK/ScutNetwork/TcpSceneManager.h @@ -64,6 +64,7 @@ namespace ScutNetwork void setNotify(INetStatusNotify* pNetNotify); void setUrlHandle(CURL* handle); void release(); + void disconnect(); protected: int getRmID(char* pdataStream, int wSize); int getNumberValue(char* pdataStream, int wSize, int& nStart, int nLength); diff --git a/SDK/ScutSDK/ScutSystem/ScutUtility.h b/SDK/ScutSDK/ScutSystem/ScutUtility.h index 3377bd26..8f0928c1 100644 --- a/SDK/ScutSDK/ScutSystem/ScutUtility.h +++ b/SDK/ScutSDK/ScutSystem/ScutUtility.h @@ -24,6 +24,8 @@ THE SOFTWARE. #ifndef _SCUTSYSTEMUTILITY_H_ #define _SCUTSYSTEMUTILITY_H_ #include +#include +#include namespace ScutSystem { class CScutUtility diff --git a/SDK/ScutSDK/ScutUtility/IPAddress.c b/SDK/ScutSDK/ScutUtility/IPAddress.c index ebdb4fe0..2c8f94fd 100644 --- a/SDK/ScutSDK/ScutUtility/IPAddress.c +++ b/SDK/ScutSDK/ScutUtility/IPAddress.c @@ -188,7 +188,7 @@ void GetHWAddresses() int a,b,c,d,e,f; int i; - strcpy(temp, (char *)ether_ntoa(LLADDR(sdl))); +// strcpy(temp, (char *)ether_ntoa(LLADDR(sdl))); sscanf(temp, "%x:%x:%x:%x:%x:%x", &a, &b, &c, &d, &e, &f); sprintf(temp, "%02X:%02X:%02X:%02X:%02X:%02X",a,b,c,d,e,f); diff --git a/SDK/ScutSDK/ScutUtility/ScutUtils.h b/SDK/ScutSDK/ScutUtility/ScutUtils.h index 4e88f830..8154de0b 100644 --- a/SDK/ScutSDK/ScutUtility/ScutUtils.h +++ b/SDK/ScutSDK/ScutUtility/ScutUtils.h @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #pragma once #include +#include namespace ScutUtility { diff --git a/SDK/ScutSDK/ScutUtility/iphone/IphoneInterface.mm b/SDK/ScutSDK/ScutUtility/iphone/IphoneInterface.mm index 5d69086e..a9f218b2 100644 --- a/SDK/ScutSDK/ScutUtility/iphone/IphoneInterface.mm +++ b/SDK/ScutSDK/ScutUtility/iphone/IphoneInterface.mm @@ -1,5 +1,5 @@ #import "IphoneInterface.h" -#import "EAGLView.h" +#import "CCEAGLView-ios.h" #import #include #include @@ -57,13 +57,14 @@ //return "460000424548924"; #ifndef ND_IPHONE_APPSTORE - NSString *strImsi = (NSString*) CTSIMSupportCopyMobileSubscriberIdentity(nil); - if (strImsi == nil || strImsi == @"") { - return getImei(); - } - return [strImsi UTF8String]; -#else - return getImei(); +// NSString *strImsi = (NSString*) CTSIMSupportCopyMobileSubscriberIdentity(nil); +// if (strImsi == nil || strImsi == @"") { +// return getImei(); +// } +// return [strImsi UTF8String]; +//#else +// return getImei(); + return "460000424548924"; #endif } diff --git a/SDK/ScutSDK/proj.android/Android.mk b/SDK/ScutSDK/proj.android/Android.mk index e3dcff03..ae401ac6 100644 --- a/SDK/ScutSDK/proj.android/Android.mk +++ b/SDK/ScutSDK/proj.android/Android.mk @@ -89,3 +89,5 @@ $(LOCAL_PATH)/../../cocos2d-x/external/curl/include/android \ LOCAL_LDLIBS := -llog include $(BUILD_STATIC_LIBRARY) + +$(call import-module,curl/prebuilt/android) diff --git a/SDK/ScutSDK/proj.ios/ScutSDK/ScutSDK.xcodeproj/project.pbxproj b/SDK/ScutSDK/proj.ios/ScutSDK/ScutSDK.xcodeproj/project.pbxproj index 6a3b42a1..577992fe 100644 --- a/SDK/ScutSDK/proj.ios/ScutSDK/ScutSDK.xcodeproj/project.pbxproj +++ b/SDK/ScutSDK/proj.ios/ScutSDK/ScutSDK.xcodeproj/project.pbxproj @@ -56,7 +56,6 @@ 1C4E24F31868310000375E56 /* ScutLuaLan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4E249A1868310000375E56 /* ScutLuaLan.cpp */; }; 1C4E24F41868310000375E56 /* ScutUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4E249C1868310000375E56 /* ScutUtils.cpp */; }; 1C4E24F718683BBB00375E56 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C4E24F618683BBB00375E56 /* QuartzCore.framework */; }; - 1C4E24F918683C9C00375E56 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C4E24F818683C9C00375E56 /* libstdc++.6.dylib */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -172,7 +171,6 @@ 1C4E249C1868310000375E56 /* ScutUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScutUtils.cpp; sourceTree = ""; }; 1C4E249D1868310000375E56 /* ScutUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScutUtils.h; sourceTree = ""; }; 1C4E24F618683BBB00375E56 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 1C4E24F818683C9C00375E56 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -180,7 +178,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1C4E24F918683C9C00375E56 /* libstdc++.6.dylib in Frameworks */, 1C4E24F718683BBB00375E56 /* QuartzCore.framework in Frameworks */, 1C4E23E918682F9700375E56 /* Foundation.framework in Frameworks */, ); @@ -209,7 +206,6 @@ 1C4E23E718682F9700375E56 /* Frameworks */ = { isa = PBXGroup; children = ( - 1C4E24F818683C9C00375E56 /* libstdc++.6.dylib */, 1C4E24F618683BBB00375E56 /* QuartzCore.framework */, 1C4E23E818682F9700375E56 /* Foundation.framework */, ); @@ -485,7 +481,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -493,7 +489,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = gnu89; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -504,7 +500,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; @@ -514,7 +510,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -522,11 +518,11 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = gnu89; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -535,8 +531,8 @@ 1C4E23F418682F9700375E56 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; DSTROOT = /tmp/ScutSDK.dst; GCC_C_LANGUAGE_STANDARD = c99; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -546,23 +542,25 @@ CC_TARGET_OS_IPHONE, ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/third_party/ios/curl\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/lua\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/layers_scenes_transitions_nodes\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/script_support\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/curl/include/ios/curl\"", + "$(SRCROOT)/../../../cocos2d-x/external/curl/include/ios", + "\"$(SRCROOT)/../../../cocos2d-x/external/glfw3/include/mac\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/lua/tolua\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/lua/lua\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/platform\"", + "\"$(SRCROOT)/../../../cocos2d-x/scripting/lua/cocos2dx_support\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/platform/ios\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/math\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/scripting/lua-bindings/manual\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/base\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/2d\"", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../ScutSystem/re_lib\"", ); + OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -572,8 +570,8 @@ 1C4E23F518682F9700375E56 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; - CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; DSTROOT = /tmp/ScutSDK.dst; GCC_C_LANGUAGE_STANDARD = c99; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -583,23 +581,25 @@ CC_TARGET_OS_IPHONE, ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/third_party/ios/curl\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/lua\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform\"", - "\"$(SRCROOT)/../../../../cocos2d-x/scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/layers_scenes_transitions_nodes\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../../cocos2d-x/cocos2dx/script_support\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/curl/include/ios/curl\"", + "$(SRCROOT)/../../../cocos2d-x/external/curl/include/ios", + "\"$(SRCROOT)/../../../cocos2d-x/external/glfw3/include/mac\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/lua/tolua\"", + "\"$(SRCROOT)/../../../cocos2d-x/external/lua/lua\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/platform\"", + "\"$(SRCROOT)/../../../cocos2d-x/scripting/lua/cocos2dx_support\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/platform/ios\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/math\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/scripting/lua-bindings/manual\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/base\"", + "\"$(SRCROOT)/../../../cocos2d-x/cocos/2d\"", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../ScutSystem/re_lib\"", ); + OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -625,6 +625,7 @@ 1C4E23F518682F9700375E56 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/SDK/ScutSDK/proj.win32/ScutSDK_2012.sln b/SDK/ScutSDK/proj.win32/ScutSDK_2012.sln new file mode 100644 index 00000000..51a24878 --- /dev/null +++ b/SDK/ScutSDK/proj.win32/ScutSDK_2012.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScutSDK_2012", "ScutSDK_2012.vcxproj", "{C5FE06AE-D28F-49DA-A6FF-9E9103CB38DA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5FE06AE-D28F-49DA-A6FF-9E9103CB38DA}.Debug|Win32.ActiveCfg = Debug|Win32 + {C5FE06AE-D28F-49DA-A6FF-9E9103CB38DA}.Debug|Win32.Build.0 = Debug|Win32 + {C5FE06AE-D28F-49DA-A6FF-9E9103CB38DA}.Release|Win32.ActiveCfg = Release|Win32 + {C5FE06AE-D28F-49DA-A6FF-9E9103CB38DA}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/SDK/ScutSDK/proj.win32/ScutSDK_2012.vcxproj b/SDK/ScutSDK/proj.win32/ScutSDK_2012.vcxproj index 8229abb3..86d9347b 100644 --- a/SDK/ScutSDK/proj.win32/ScutSDK_2012.vcxproj +++ b/SDK/ScutSDK/proj.win32/ScutSDK_2012.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -116,14 +116,14 @@ StaticLibrary true MultiByte - v110 + v120 StaticLibrary false true MultiByte - v110 + v120 diff --git a/SDK/ScutSDK/tolua/DataRequest.pkg b/SDK/ScutSDK/tolua/DataRequest.pkg index 087c64a6..a6783314 100644 --- a/SDK/ScutSDK/tolua/DataRequest.pkg +++ b/SDK/ScutSDK/tolua/DataRequest.pkg @@ -13,6 +13,8 @@ namespace ScutDataLogic { public: static CDataRequest* Instance(); + + void disconnect(); //ִͬ bool ExecRequest(void* pScene); //ݵĴ ĿǰĬNdScene diff --git a/SDK/ScutSDK/tolua/NetHelper.pkg b/SDK/ScutSDK/tolua/NetHelper.pkg index 9da07870..85b8b891 100644 --- a/SDK/ScutSDK/tolua/NetHelper.pkg +++ b/SDK/ScutSDK/tolua/NetHelper.pkg @@ -23,7 +23,7 @@ namespace ScutDataLogic static void setSessionID(const char* pszSessionID); static void setUserID(CInt64 value); static void setStime(const char* pszTime); - + int getTag(); }; @@ -36,8 +36,8 @@ namespace ScutDataLogic /*෽ bool recordBegin(); - void recordEnd() - + void recordEnd(); + bool pushNetStream(char* pdataStream,int wSize); unsigned char getBYTE(void); unsigned short getWORD(void); unsigned int getDWORD(void); @@ -51,7 +51,7 @@ namespace ScutDataLogic void getString(CLuaString* pOutString, int nLength); unsigned char getByte(void); unsigned short getWord(void); - + static CNetReader* getInstance(); diff --git a/SDK/ScutSDK/tolua/NetStreamExport.pkg b/SDK/ScutSDK/tolua/NetStreamExport.pkg index 5b29aaf1..bc528c34 100644 --- a/SDK/ScutSDK/tolua/NetStreamExport.pkg +++ b/SDK/ScutSDK/tolua/NetStreamExport.pkg @@ -8,7 +8,7 @@ namespace ScutDataLogic bool recordBegin(); void recordEnd(); - + bool pushNetStream(char* pdataStream,int wSize); unsigned char getBYTE(void); unsigned short getWORD(void); unsigned int getDWORD(void); diff --git a/SDK/ScutSDK/tolua/ScutExt.tolua b/SDK/ScutSDK/tolua/ScutExt.tolua index f022cdc8..9e6d58b4 100644 --- a/SDK/ScutSDK/tolua/ScutExt.tolua +++ b/SDK/ScutSDK/tolua/ScutExt.tolua @@ -3,6 +3,7 @@ class ScutExt static void Init(const std::string& resRootDir); static ScutExt* getInstance(); + /** Pauses the running scene for lua */ void RegisterPauseHandler(const char* pszFuncName); diff --git a/Source/Framework/FrameworkUnitTest/Cache/JsonCacheUnitTest.cs b/Source/Framework/FrameworkUnitTest/Cache/JsonCacheUnitTest.cs index 5e4b84f9..8ea29493 100644 --- a/Source/Framework/FrameworkUnitTest/Cache/JsonCacheUnitTest.cs +++ b/Source/Framework/FrameworkUnitTest/Cache/JsonCacheUnitTest.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ using System; +using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -32,13 +33,19 @@ THE SOFTWARE. using System.Threading; using System.Threading.Tasks; using FrameworkUnitTest.Cache.Model; +using IronPython.Modules; +using IronPython.Runtime; using Microsoft.VisualStudio.TestTools.UnitTesting; +using ServiceStack.Redis; using ZyGames.Framework.Cache.Generic; using ZyGames.Framework.Common; +using ZyGames.Framework.Common.Build; using ZyGames.Framework.Common.Configuration; using ZyGames.Framework.Common.Serialization; +using ZyGames.Framework.Config; using ZyGames.Framework.Data; using ZyGames.Framework.Model; +using ZyGames.Framework.Net; using ZyGames.Framework.Redis; namespace FrameworkUnitTest.Cache @@ -175,6 +182,23 @@ public void RedisListTest() #endregion #region cache + + [TestMethod] + public void ModifyPackage() + { + var watch = Stopwatch.StartNew(); + UserPackage package = PersonalCacheStruct.GetOrAdd("10000", new Lazy(() => + { + return new UserPackage() {UserId = 10000}; + })); + + package.ModifyLocked(() => + { + package.Items[100] = 1; + }); + WaitEnd(watch); + } + [TestMethod] public void AddFieldAll() { diff --git a/Source/Framework/FrameworkUnitTest/Cache/MathTest.cs b/Source/Framework/FrameworkUnitTest/Cache/MathTest.cs index 73e21a9b..9391102d 100644 --- a/Source/Framework/FrameworkUnitTest/Cache/MathTest.cs +++ b/Source/Framework/FrameworkUnitTest/Cache/MathTest.cs @@ -31,6 +31,7 @@ THE SOFTWARE. using System.Threading; using System.Threading.Tasks; using FrameworkUnitTest.Cache.Model; +using IronPython.Modules; using Microsoft.VisualStudio.TestTools.UnitTesting; using ProtoBuf; using ZyGames.Framework.Cache.Generic; @@ -39,6 +40,7 @@ THE SOFTWARE. using ZyGames.Framework.Common.Serialization; using ZyGames.Framework.Common.Threading; using ZyGames.Framework.Common.Timing; +using ZyGames.Framework.Redis; namespace FrameworkUnitTest.Cache { diff --git a/Source/Framework/FrameworkUnitTest/Cache/Model/KeyData.cs b/Source/Framework/FrameworkUnitTest/Cache/Model/KeyData.cs index 05400c50..33b16267 100644 --- a/Source/Framework/FrameworkUnitTest/Cache/Model/KeyData.cs +++ b/Source/Framework/FrameworkUnitTest/Cache/Model/KeyData.cs @@ -22,6 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using IronPython.Modules; using ProtoBuf; using ZyGames.Framework.Model; @@ -53,7 +58,7 @@ public class UserKeyData :BaseEntity [ProtoMember(1)] [EntityField(true)] - public int UserId { get; set; } + public long UserId { get; set; } [ProtoMember(2)] [EntityField(true)] @@ -63,7 +68,7 @@ public class UserKeyData :BaseEntity [EntityField] public string Value { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserId; } diff --git a/Source/Framework/FrameworkUnitTest/Cache/Model/UserFriend.cs b/Source/Framework/FrameworkUnitTest/Cache/Model/UserFriend.cs index 292b9583..d564546c 100644 --- a/Source/Framework/FrameworkUnitTest/Cache/Model/UserFriend.cs +++ b/Source/Framework/FrameworkUnitTest/Cache/Model/UserFriend.cs @@ -33,6 +33,29 @@ THE SOFTWARE. namespace FrameworkUnitTest.Cache.Model { + [Serializable] + [ProtoContract] + [EntityTable(CacheType.Dictionary, MyDataConfigger.DbKey)] + public class UserPackage : BaseEntity + { + public UserPackage() + { + Items = new CacheDictionary(); + } + [ProtoMember(1)] + [EntityField(true)] + public long UserId { get; set; } + + [ProtoMember(2)] + [EntityField(true, ColumnDbType.LongText)] + public CacheDictionary Items { get; set; } + + protected override long GetIdentityId() + { + return UserId; + } + } + [Serializable] [ProtoContract] [EntityTable(CacheType.Dictionary, MyDataConfigger.DbKey)] @@ -46,9 +69,9 @@ public class UserFriendState : BaseEntity [EntityField] public bool Enable { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { - return (int) UserId; + return UserId; } } @@ -178,9 +201,9 @@ public CacheDictionary FriendDict public Dictionary Dicts { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { - return (int)UserId; + return UserId; } } } diff --git a/Source/Framework/FrameworkUnitTest/Cache/Model/UserMail.cs b/Source/Framework/FrameworkUnitTest/Cache/Model/UserMail.cs index c145edd5..607a6c0b 100644 --- a/Source/Framework/FrameworkUnitTest/Cache/Model/UserMail.cs +++ b/Source/Framework/FrameworkUnitTest/Cache/Model/UserMail.cs @@ -25,7 +25,7 @@ public class UserMail: BaseEntity [EntityField] public bool Enable { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return (int) UserId; } diff --git a/Source/Framework/FrameworkUnitTest/Rpc/SocketTest.cs b/Source/Framework/FrameworkUnitTest/Rpc/SocketTest.cs index 50011370..8fe1714f 100644 --- a/Source/Framework/FrameworkUnitTest/Rpc/SocketTest.cs +++ b/Source/Framework/FrameworkUnitTest/Rpc/SocketTest.cs @@ -1,9 +1,12 @@ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Net; using System.Text; using System.Threading; using System.Threading.Tasks; +using IronPython.Modules; using Microsoft.VisualStudio.TestTools.UnitTesting; using ZyGames.Framework.Collection.Generic; using ZyGames.Framework.Common.Configuration; diff --git a/Source/Framework/Solution Items/GlobalAssemblyInfo.cs b/Source/Framework/Solution Items/GlobalAssemblyInfo.cs index bb712f14..54e8d85d 100644 --- a/Source/Framework/Solution Items/GlobalAssemblyInfo.cs +++ b/Source/Framework/Solution Items/GlobalAssemblyInfo.cs @@ -31,7 +31,7 @@ THE SOFTWARE. // Revision // // -[assembly: AssemblyVersion("6.7.0.407")] +[assembly: AssemblyVersion("6.7.0.409")] [assembly: AssemblyCompany("scutgame.com")] [assembly: AssemblyProduct("SCUT Server Engine")] [assembly: AssemblyCopyright("Copyright © 2013-2015 Gavin Wu")] diff --git a/Source/Framework/ZyGames.Framework.Common/ObjectExtend.cs b/Source/Framework/ZyGames.Framework.Common/ObjectExtend.cs index 4440fbf0..46218832 100644 --- a/Source/Framework/ZyGames.Framework.Common/ObjectExtend.cs +++ b/Source/Framework/ZyGames.Framework.Common/ObjectExtend.cs @@ -212,6 +212,17 @@ public static int IndexOf(this byte[] bytes, int offset, int length, byte[] patt { return MathUtils.IndexOf(bytes, offset, length, pattern); } + /// + /// + /// + /// + /// + /// + /// + public static T[] RandomTake(this T[] source, int count) + { + return RandomUtils.RandomTake(source, count); + } /// /// @@ -223,7 +234,17 @@ public static T[] RandomSort(this T[] array) { return RandomUtils.RandomSort(array); } - + /// + /// + /// + /// + /// + /// + /// + public static List RandomTake(this List source, int count) + { + return RandomUtils.RandomTake(source, count); + } /// /// /// diff --git a/Source/Framework/ZyGames.Framework.Common/RandomUtils.cs b/Source/Framework/ZyGames.Framework.Common/RandomUtils.cs index fa71f01f..acc568a2 100644 --- a/Source/Framework/ZyGames.Framework.Common/RandomUtils.cs +++ b/Source/Framework/ZyGames.Framework.Common/RandomUtils.cs @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ using System; using System.Collections.Generic; +using System.Linq; namespace ZyGames.Framework.Common { @@ -34,7 +35,7 @@ public static class RandomUtils { private static int MinPercent = 1; private static int MaxPercent = 100; - private static Random random = new Random(); + private static Random random = new Random(Environment.TickCount); /// /// 随机取名字 @@ -176,7 +177,7 @@ public static bool IsHit(decimal percent) { return NextBool((double)percent); } - + /// /// /// @@ -439,6 +440,18 @@ public static int[] GetRandomNew(int count, int randomMin, int randomMax, int to return values; } + /// + /// + /// + /// + /// + /// + /// + public static T[] RandomTake(T[] source, int count) + { + return RandomSort(source).Take(count).ToArray(); + } + /// /// /// @@ -446,21 +459,30 @@ public static int[] GetRandomNew(int count, int randomMin, int randomMax, int to /// public static T[] RandomSort(T[] source) { - int num = source.Length / 2; - for (int i = 0; i < num; i++) + int pos; + T temp; + var count = source.Length / 2; + for (int i = 0; i < count; i++) { - int num2 = GetRandom(0, source.Length); - int num3 = GetRandom(0, source.Length); - if (num2 != num3) - { - T t = source[num3]; - source[num3] = source[num2]; - source[num2] = t; - } + temp = source[i]; + pos = GetRandom(i + 1, source.Length); + source[i] = source[pos]; + source[pos] = temp; } return source; } + /// + /// + /// + /// + /// + /// + /// + public static List RandomTake(List source, int count) + { + return RandomSort(source).Take(count).ToList(); + } /// /// /// @@ -468,17 +490,15 @@ public static T[] RandomSort(T[] source) /// public static List RandomSort(List source) { - int num = source.Count / 2; - for (int i = 0; i < num; i++) + int pos; + T temp; + var count = source.Count / 2; + for (int i = 0; i < count; i++) { - int num2 = GetRandom(0, source.Count); - int num3 = GetRandom(0, source.Count); - if (num2 != num3) - { - T t = source[num3]; - source[num3] = source[num2]; - source[num2] = t; - } + temp = source[i]; + pos = GetRandom(i + 1, source.Count); + source[i] = source[pos]; + source[pos] = temp; } return source; } diff --git a/Source/Framework/ZyGames.Framework/Cache/Generic/PersonalCacheStruct.cs b/Source/Framework/ZyGames.Framework/Cache/Generic/PersonalCacheStruct.cs index 3cd3ad46..b039646b 100644 --- a/Source/Framework/ZyGames.Framework/Cache/Generic/PersonalCacheStruct.cs +++ b/Source/Framework/ZyGames.Framework/Cache/Generic/PersonalCacheStruct.cs @@ -214,6 +214,11 @@ public static object GetCache(string entityName) /// public static T GetOrAdd(string personalId, Lazy createFactory, params object[] keys) where T : BaseEntity, new() { + var primaryKeys = EntitySchemaSet.Get().Keys; + if (primaryKeys.Length > 1 && keys.Length != primaryKeys.Length) + { + throw new ArgumentNullException("keys", string.Format("Set args:\"{0}\" value error.", string.Join(",", primaryKeys))); + } var cache = new PersonalCacheStruct(); T result; LoadingStatus status; diff --git a/Source/Framework/ZyGames.Framework/Data/DbBaseProvider.cs b/Source/Framework/ZyGames.Framework/Data/DbBaseProvider.cs index c63e313e..60f2d1b8 100644 --- a/Source/Framework/ZyGames.Framework/Data/DbBaseProvider.cs +++ b/Source/Framework/ZyGames.Framework/Data/DbBaseProvider.cs @@ -240,7 +240,7 @@ public int ExecuteQuery(CommandType commandType, string commandText, params IDat /// /// /// - public int ExecuteNonQuery(int identityId, CommandType commandType, string commandText, params IDataParameter[] parameters) + public int ExecuteNonQuery(long identityId, CommandType commandType, string commandText, params IDataParameter[] parameters) { return ExecuteNonQuery(identityId, commandType, null, commandText, parameters); } @@ -254,7 +254,7 @@ public int ExecuteNonQuery(int identityId, CommandType commandType, string comma /// /// /// - public abstract int ExecuteNonQuery(int identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters); + public abstract int ExecuteNonQuery(long identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters); /// /// 生成Sql命令对象 @@ -262,7 +262,7 @@ public int ExecuteNonQuery(int identityId, CommandType commandType, string comma /// /// /// - public abstract SqlStatement GenerateSql(int identityId, CommandStruct command); + public abstract SqlStatement GenerateSql(long identityId, CommandStruct command); /// /// 检查是否有指定表名 diff --git a/Source/Framework/ZyGames.Framework/Data/MySql/MySqlDataProvider.cs b/Source/Framework/ZyGames.Framework/Data/MySql/MySqlDataProvider.cs index 327a142c..87e4dbd0 100644 --- a/Source/Framework/ZyGames.Framework/Data/MySql/MySqlDataProvider.cs +++ b/Source/Framework/ZyGames.Framework/Data/MySql/MySqlDataProvider.cs @@ -87,7 +87,7 @@ public override IDataReader ExecuteReader(CommandType commandType, int? commandT try { conn.Open(); - } + } catch (Exception ex) { throw new DbConnectionException(ex.Message, ex); @@ -114,7 +114,7 @@ public override object ExecuteScalar(CommandType commandType, int? commandTimeou { result = MySqlHelper.ExecuteScalar(conn, commandText, ConvertParam(parameters)); return; - } + } using (var mySqlCommand = CreateMySqlCommand(conn, null, commandTimeout, commandText)) { result = mySqlCommand.ExecuteScalar(); @@ -141,7 +141,7 @@ public override int ExecuteQuery(CommandType commandType, int? commandTimeout, s { result = MySqlHelper.ExecuteNonQuery(conn, commandText, ConvertParam(parameters)); return; - } + } using (var mySqlCommand = CreateMySqlCommand(conn, null, commandTimeout, commandText)) { result = mySqlCommand.ExecuteNonQuery(); @@ -240,7 +240,7 @@ public override IEnumerable ExecuteQuery(IEnumerable command /// /// /// - public override int ExecuteNonQuery(int identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters) + public override int ExecuteNonQuery(long identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters) { SqlStatement statement = new SqlStatement(); statement.IdentityID = identityId; @@ -258,7 +258,7 @@ public override int ExecuteNonQuery(int identityId, CommandType commandType, str /// /// /// - public override SqlStatement GenerateSql(int identityId, CommandStruct command) + public override SqlStatement GenerateSql(long identityId, CommandStruct command) { command.Parser(); SqlStatement statement = new SqlStatement(); @@ -315,9 +315,9 @@ public override bool CheckTable(string tableName, out DbColumn[] columns) } result = true; }); - columns = list.ToArray(); + columns = list.ToArray(); return result; - } + } private Type ConvertToObjectType(MySqlDbType toEnum) { @@ -646,84 +646,84 @@ public override void CreateColumn(string tableName, DbColumn[] columns) StringBuilder command = new StringBuilder(); OpenConnection(conn => { - try - { - string dbTableName = FormatName(tableName); - command.AppendFormat("ALTER TABLE {0}", dbTableName); - command.AppendLine(" ADD COLUMN ("); - List keys; - List uniques; - int identityNo; - bool hasColumn = CheckProcessColumns(command, columns, out keys, out uniques, out identityNo); - command.Append(");"); - if (hasColumn) + try { - MySqlHelper.ExecuteNonQuery(conn, command.ToString()); - if (identityNo > 0) + string dbTableName = FormatName(tableName); + command.AppendFormat("ALTER TABLE {0}", dbTableName); + command.AppendLine(" ADD COLUMN ("); + List keys; + List uniques; + int identityNo; + bool hasColumn = CheckProcessColumns(command, columns, out keys, out uniques, out identityNo); + command.Append(");"); + if (hasColumn) { + MySqlHelper.ExecuteNonQuery(conn, command.ToString()); + if (identityNo > 0) + { MySqlHelper.ExecuteNonQuery(conn, string.Format("ALTER TABLE {0} AUTO_INCREMENT={1};", dbTableName, identityNo)); + } } - } - command.Clear(); - List keyColumns = new List(); - int index = 0; - foreach (var dbColumn in columns) - { - if (!dbColumn.IsModify) - { - continue; - } - if (dbColumn.IsKey) + command.Clear(); + List keyColumns = new List(); + int index = 0; + foreach (var dbColumn in columns) { - keyColumns.Add(dbColumn); - continue; + if (!dbColumn.IsModify) + { + continue; + } + if (dbColumn.IsKey) + { + keyColumns.Add(dbColumn); + continue; + } + if (index > 0) + { + command.AppendLine(""); + } + //ALTER TABLE `test`.`tb1` CHANGE `Id4` `Id4t` BIGINT(20) NULL ; + command.AppendFormat("ALTER TABLE {0} CHANGE {1} {1} {2} {3};", + dbTableName, + FormatName(dbColumn.Name), + ConvertToDbType(dbColumn.Type, dbColumn.DbType, dbColumn.Length, dbColumn.Scale, dbColumn.IsKey, dbColumn.Name), + dbColumn.Isnullable ? "" : " NOT NULL"); + index++; } - if (index > 0) + //此处MySQL的处理主键方式不太一样 + if (keyColumns.Count > 0) { - command.AppendLine(""); - } - //ALTER TABLE `test`.`tb1` CHANGE `Id4` `Id4t` BIGINT(20) NULL ; - command.AppendFormat("ALTER TABLE {0} CHANGE {1} {1} {2} {3};", - dbTableName, - FormatName(dbColumn.Name), - ConvertToDbType(dbColumn.Type, dbColumn.DbType, dbColumn.Length, dbColumn.Scale, dbColumn.IsKey, dbColumn.Name), - dbColumn.Isnullable ? "" : " NOT NULL"); - index++; - } - //此处MySQL的处理主键方式不太一样 - if (keyColumns.Count > 0) - { - string[] keyArray = new string[keyColumns.Count]; + string[] keyArray = new string[keyColumns.Count]; if (keyColumns.Any(t => t.KeyNo > 0)) { //check haved key in db table command.AppendFormat("ALTER TABLE {0} DROP PRIMARY KEY;", dbTableName); command.AppendLine(); } - int i = 0; - foreach (var keyColumn in keyColumns) + int i = 0; + foreach (var keyColumn in keyColumns) + { + keyArray[i] = FormatName(keyColumn.Name); + command.AppendFormat("ALTER TABLE {0} CHANGE {1} {1} {2} not null;", + dbTableName, + FormatName(keyColumn.Name), + ConvertToDbType(keyColumn.Type, keyColumn.DbType, keyColumn.Length, keyColumn.Scale, keyColumn.IsKey, keyColumn.Name)); + command.AppendLine(); + i++; + index++; + } + command.AppendFormat("ALTER TABLE {0} ADD PRIMARY KEY ({1});", dbTableName, FormatQueryColumn(",", keyArray)); + } + if (index > 0) { - keyArray[i] = FormatName(keyColumn.Name); - command.AppendFormat("ALTER TABLE {0} CHANGE {1} {1} {2} not null;", - dbTableName, - FormatName(keyColumn.Name), - ConvertToDbType(keyColumn.Type, keyColumn.DbType, keyColumn.Length, keyColumn.Scale, keyColumn.IsKey, keyColumn.Name)); - command.AppendLine(); - i++; - index++; + MySqlHelper.ExecuteNonQuery(conn, command.ToString()); } - command.AppendFormat("ALTER TABLE {0} ADD PRIMARY KEY ({1});", dbTableName, FormatQueryColumn(",", keyArray)); } - if (index > 0) + catch (Exception ex) { - MySqlHelper.ExecuteNonQuery(conn, command.ToString()); + throw new Exception(string.Format("Execute sql error:{0}", command), ex); } - } - catch (Exception ex) - { - throw new Exception(string.Format("Execute sql error:{0}", command), ex); - } }); } diff --git a/Source/Framework/ZyGames.Framework/Data/Sql/SqlDataProvider.cs b/Source/Framework/ZyGames.Framework/Data/Sql/SqlDataProvider.cs index 4ecc6e74..e9a02cba 100644 --- a/Source/Framework/ZyGames.Framework/Data/Sql/SqlDataProvider.cs +++ b/Source/Framework/ZyGames.Framework/Data/Sql/SqlDataProvider.cs @@ -86,7 +86,7 @@ public override IDataReader ExecuteReader(CommandType commandType, int? commandT try { conn.Open(); - } + } catch (Exception ex) { throw new DbConnectionException(ex.Message, ex); @@ -119,7 +119,7 @@ public override object ExecuteScalar(CommandType commandType, int? commandTimeou { result = SqlHelper.ExecuteScalar(conn, commandType, commandText, ConvertParam(parameters)); return; - } + } using (var cmd = CreateSqlCommand(conn, null, commandTimeout, commandText)) { result = cmd.ExecuteScalar(); @@ -145,7 +145,7 @@ public override int ExecuteQuery(CommandType commandType, int? commandTimeout, s { result = SqlHelper.ExecuteNonQuery(conn, commandType, commandText, ConvertParam(parameters)); return; - } + } using (var cmd = CreateSqlCommand(conn, null, commandTimeout, commandText)) { result = cmd.ExecuteNonQuery(); @@ -220,7 +220,7 @@ public override IEnumerable ExecuteQuery(IEnumerable command /// /// /// - public override int ExecuteNonQuery(int identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters) + public override int ExecuteNonQuery(long identityId, CommandType commandType, string tableName, string commandText, params IDataParameter[] parameters) { SqlStatement statement = new SqlStatement(); statement.IdentityID = identityId; @@ -238,7 +238,7 @@ public override int ExecuteNonQuery(int identityId, CommandType commandType, str /// /// /// - public override SqlStatement GenerateSql(int identityId, CommandStruct command) + public override SqlStatement GenerateSql(long identityId, CommandStruct command) { command.Parser(); SqlStatement statement = new SqlStatement(); @@ -274,9 +274,9 @@ public override bool CheckTable(string tableName, out DbColumn[] columns) var list = new List(); OpenConnection(conn => { - string commandText = string.Format("SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'{0}') AND type in (N'U')", tableName); + string commandText = string.Format("SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'{0}') AND type in (N'U')", tableName); if (SqlHelper.ExecuteScalar(conn, CommandType.Text, commandText).ToInt() > 0) - { + { commandText = string.Format(@" select c.name as ColumnName, @@ -293,27 +293,27 @@ order by colorder ASC ", tableName); using (var dataReader = SqlHelper.ExecuteReader(conn, CommandType.Text, commandText)) - { - while (dataReader.Read()) { - var column = new DbColumn(); - column.Name = dataReader[0].ToNotNullString(); - column.DbType = dataReader[1].ToNotNullString(); - column.Scale = dataReader[2].ToInt(); - column.Length = dataReader[3].ToLong(); + while (dataReader.Read()) + { + var column = new DbColumn(); + column.Name = dataReader[0].ToNotNullString(); + column.DbType = dataReader[1].ToNotNullString(); + column.Scale = dataReader[2].ToInt(); + column.Length = dataReader[3].ToLong(); column.Isnullable = dataReader[4].ToBool(); column.KeyNo = dataReader[5].ToInt(); column.HaveIncrement = dataReader["auto_increment"].ToBool(); - column.Type = ConvertToObjectType(ConvertToDbType(column.DbType)); - list.Add(column); + column.Type = ConvertToObjectType(ConvertToDbType(column.DbType)); + list.Add(column); + } } - } result = true; } }); - columns = list.ToArray(); + columns = list.ToArray(); return result; - } + } private Type ConvertToObjectType(SqlDbType toEnum) { @@ -657,81 +657,81 @@ public override void CreateColumn(string tableName, DbColumn[] columns) StringBuilder command = new StringBuilder(); OpenConnection(conn => { - try - { - string dbTableName = FormatName(tableName); - command.AppendFormat("Alter Table {0}", dbTableName); - command.AppendLine(" Add"); - List keys; - List uniques; - bool hasColumn = CheckProcessColumns(command, columns, out keys, out uniques); - command.Append(";"); - if (hasColumn) - { - SqlHelper.ExecuteNonQuery(conn, CommandType.Text, command.ToString()); - } - - command.Clear(); - List keyColumns = new List(); - int index = 0; - foreach (var dbColumn in columns) + try { - if (!dbColumn.IsModify) + string dbTableName = FormatName(tableName); + command.AppendFormat("Alter Table {0}", dbTableName); + command.AppendLine(" Add"); + List keys; + List uniques; + bool hasColumn = CheckProcessColumns(command, columns, out keys, out uniques); + command.Append(";"); + if (hasColumn) { - continue; + SqlHelper.ExecuteNonQuery(conn, CommandType.Text, command.ToString()); } - if (dbColumn.IsKey) + + command.Clear(); + List keyColumns = new List(); + int index = 0; + foreach (var dbColumn in columns) { - keyColumns.Add(dbColumn); - continue; + if (!dbColumn.IsModify) + { + continue; + } + if (dbColumn.IsKey) + { + keyColumns.Add(dbColumn); + continue; + } + if (index > 0) + { + command.AppendLine(""); + } + command.AppendFormat("Alter Table {0} ALTER COLUMN {1} {2}{3}{4};", + dbTableName, + FormatName(dbColumn.Name), + ConvertToDbType(dbColumn.Type, dbColumn.DbType, dbColumn.Length, dbColumn.Scale, dbColumn.IsKey), + dbColumn.Isnullable ? "" : " not null", + (dbColumn.IsIdentity ? dbColumn.IdentityNo > 0 ? string.Format(" IDENTITY({0},1)", dbColumn.IdentityNo) : " IDENTITY(1,1)" : "")); + index++; } - if (index > 0) + if (keyColumns.Count > 0) { - command.AppendLine(""); - } - command.AppendFormat("Alter Table {0} ALTER COLUMN {1} {2}{3}{4};", - dbTableName, - FormatName(dbColumn.Name), - ConvertToDbType(dbColumn.Type, dbColumn.DbType, dbColumn.Length, dbColumn.Scale, dbColumn.IsKey), - dbColumn.Isnullable ? "" : " not null", - (dbColumn.IsIdentity ? dbColumn.IdentityNo > 0 ? string.Format(" IDENTITY({0},1)", dbColumn.IdentityNo) : " IDENTITY(1,1)" : "")); - index++; - } - if (keyColumns.Count > 0) - { - string[] keyArray = new string[keyColumns.Count]; + string[] keyArray = new string[keyColumns.Count]; if (keyColumns.Any(t => t.KeyNo > 0)) { //check haved key in db table command.AppendFormat("ALTER TABLE {0} DROP CONSTRAINT PK_{1};", dbTableName, tableName); command.AppendLine(); } - int i = 0; - foreach (var keyColumn in keyColumns) + int i = 0; + foreach (var keyColumn in keyColumns) + { + keyArray[i] = FormatName(keyColumn.Name); + command.AppendFormat("Alter Table {0} ALTER COLUMN {1} {2} not null;", + dbTableName, + FormatName(keyColumn.Name), + ConvertToDbType(keyColumn.Type, keyColumn.DbType, keyColumn.Length, keyColumn.Scale, keyColumn.IsKey)); + command.AppendLine(); + i++; + index++; + } + command.AppendFormat("ALTER TABLE {0} ADD CONSTRAINT PK_{1} PRIMARY KEY({2});", + dbTableName, + tableName, + FormatQueryColumn(",", keyArray)); + } + if (index > 0) { - keyArray[i] = FormatName(keyColumn.Name); - command.AppendFormat("Alter Table {0} ALTER COLUMN {1} {2} not null;", - dbTableName, - FormatName(keyColumn.Name), - ConvertToDbType(keyColumn.Type, keyColumn.DbType, keyColumn.Length, keyColumn.Scale, keyColumn.IsKey)); - command.AppendLine(); - i++; - index++; + SqlHelper.ExecuteNonQuery(conn, CommandType.Text, command.ToString()); } - command.AppendFormat("ALTER TABLE {0} ADD CONSTRAINT PK_{1} PRIMARY KEY({2});", - dbTableName, - tableName, - FormatQueryColumn(",", keyArray)); } - if (index > 0) + catch (Exception ex) { - SqlHelper.ExecuteNonQuery(conn, CommandType.Text, command.ToString()); + throw new Exception(string.Format("Execute sql error:{0}", command), ex); } - } - catch (Exception ex) - { - throw new Exception(string.Format("Execute sql error:{0}", command), ex); - } }); } diff --git a/Source/Framework/ZyGames.Framework/Data/SqlStatement.cs b/Source/Framework/ZyGames.Framework/Data/SqlStatement.cs index 45afab70..963bfcf1 100644 --- a/Source/Framework/ZyGames.Framework/Data/SqlStatement.cs +++ b/Source/Framework/ZyGames.Framework/Data/SqlStatement.cs @@ -46,7 +46,7 @@ public SqlStatement() /// 标识ID /// [ProtoMember(1)] - public int IdentityID { get; set; } + public long IdentityID { get; set; } /// /// 数据库连接串设置 diff --git a/Source/Framework/ZyGames.Framework/Data/SqlStatementManager.cs b/Source/Framework/ZyGames.Framework/Data/SqlStatementManager.cs index 6c3dc050..252f54ec 100644 --- a/Source/Framework/ZyGames.Framework/Data/SqlStatementManager.cs +++ b/Source/Framework/ZyGames.Framework/Data/SqlStatementManager.cs @@ -216,9 +216,9 @@ private static bool PutError(byte[] value, string key = null) /// /// /// - internal static string GetSqlQueueKey(int identityId) + internal static string GetSqlQueueKey(long identityId) { - int index = Math.Abs(identityId) % _queueWatchTimers.Length; + var index = Math.Abs(identityId) % _queueWatchTimers.Length; string queueKey = string.Format("{0}{1}{2}", SlaveMessageQueue, SqlSyncQueueKey, diff --git a/Source/Framework/ZyGames.Framework/Model/AbstractEntity.cs b/Source/Framework/ZyGames.Framework/Model/AbstractEntity.cs index e9b57093..77cb82f4 100644 --- a/Source/Framework/ZyGames.Framework/Model/AbstractEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/AbstractEntity.cs @@ -49,7 +49,7 @@ public abstract class AbstractEntity : EntityChangeEvent, IDataExpired, ISqlEnti /// /// /// - protected const int DefIdentityId = 10000; + protected const long DefIdentityId = 10000; /// /// 存储改变的属性集合 /// @@ -302,7 +302,7 @@ public virtual string PersonalId { get { - int id = GetIdentityId(); + var id = GetIdentityId(); if (id == 0) { TraceLog.WriteError("The {0} property \"PersonalId\" is empty.", _schema.EntityType.FullName); @@ -328,7 +328,7 @@ public virtual string PersonalId /// /// /// - public int GetMessageQueueId() + public long GetMessageQueueId() { return GetIdentityId(); } @@ -336,7 +336,7 @@ public int GetMessageQueueId() /// /// 标识ID,消息队列分发 /// - internal protected abstract int GetIdentityId(); + internal protected abstract long GetIdentityId(); /// /// 当前对象(包括继承)的属性触发通知事件 diff --git a/Source/Framework/ZyGames.Framework/Model/ISqlEntity.cs b/Source/Framework/ZyGames.Framework/Model/ISqlEntity.cs index 68b85e43..55377a09 100644 --- a/Source/Framework/ZyGames.Framework/Model/ISqlEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/ISqlEntity.cs @@ -41,7 +41,7 @@ public interface ISqlEntity /// Message queue group id. /// /// - int GetMessageQueueId(); + long GetMessageQueueId(); /// /// diff --git a/Source/Framework/ZyGames.Framework/Model/LogEntity.cs b/Source/Framework/ZyGames.Framework/Model/LogEntity.cs index c8b0157d..982a940c 100644 --- a/Source/Framework/ZyGames.Framework/Model/LogEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/LogEntity.cs @@ -45,7 +45,7 @@ protected LogEntity() /// /// /// - protected internal override int GetIdentityId() + protected internal override long GetIdentityId() { return DefIdentityId; } diff --git a/Source/Framework/ZyGames.Framework/Model/MemoryEntity.cs b/Source/Framework/ZyGames.Framework/Model/MemoryEntity.cs index 47940455..3110b486 100644 --- a/Source/Framework/ZyGames.Framework/Model/MemoryEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/MemoryEntity.cs @@ -79,7 +79,7 @@ public virtual string GetKeyCode() /// /// /// - public virtual int GetMessageQueueId() + public virtual long GetMessageQueueId() { return 0; } diff --git a/Source/Framework/ZyGames.Framework/Model/RankEntity.cs b/Source/Framework/ZyGames.Framework/Model/RankEntity.cs index 7036fdb0..ef86b349 100644 --- a/Source/Framework/ZyGames.Framework/Model/RankEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/RankEntity.cs @@ -58,7 +58,7 @@ protected RankEntity() /// /// /// - internal protected override int GetIdentityId() + internal protected override long GetIdentityId() { return DefIdentityId; } diff --git a/Source/Framework/ZyGames.Framework/Model/ShareEntity.cs b/Source/Framework/ZyGames.Framework/Model/ShareEntity.cs index 46d0925c..3ab5fefc 100644 --- a/Source/Framework/ZyGames.Framework/Model/ShareEntity.cs +++ b/Source/Framework/ZyGames.Framework/Model/ShareEntity.cs @@ -61,7 +61,7 @@ protected ShareEntity(AccessLevel access) /// /// /// - protected internal override int GetIdentityId() + protected internal override long GetIdentityId() { return DefIdentityId; } diff --git a/Source/Framework/ZyGames.Framework/Net/Sql/SqlDataSender.cs b/Source/Framework/ZyGames.Framework/Net/Sql/SqlDataSender.cs index f2d26273..d20df3cb 100644 --- a/Source/Framework/ZyGames.Framework/Net/Sql/SqlDataSender.cs +++ b/Source/Framework/ZyGames.Framework/Net/Sql/SqlDataSender.cs @@ -100,7 +100,7 @@ internal SqlStatement GenerateSqlQueue(T data, EntityPropertyGetFunc getFu CommandStruct command = GenerateCommand(dbProvider, data, schemaTable, getFunc, postColumnFunc); if (command != null) { - int identityId = data.GetMessageQueueId(); + var identityId = data.GetMessageQueueId(); return dbProvider.GenerateSql(identityId, command); } } diff --git "a/Source/Framework/\345\217\221\345\270\203\345\244\204\347\220\206.bat" "b/Source/Framework/\345\217\221\345\270\203\345\244\204\347\220\206.bat" index 86f2a402..7c2f6850 100644 --- "a/Source/Framework/\345\217\221\345\270\203\345\244\204\347\220\206.bat" +++ "b/Source/Framework/\345\217\221\345\270\203\345\244\204\347\220\206.bat" @@ -1,6 +1,6 @@ @echo off -xcopy /y lib\*.dll ..\..\Release\6.7.9.11\Lib\ -xcopy /y ZyGames.Framework\bin\ZyGames.Framework.* ..\..\Release\6.7.9.11\Lib\ -xcopy /y ZyGames.Framework.Common\bin\ZyGames.Framework.Common.* ..\..\Release\6.7.9.11\Lib\ +xcopy /y lib\*.dll ..\..\Release\6.7.10.0\Lib\ +xcopy /y ZyGames.Framework\bin\ZyGames.Framework.* ..\..\Release\6.7.10.0\Lib\ +xcopy /y ZyGames.Framework.Common\bin\ZyGames.Framework.Common.* ..\..\Release\6.7.10.0\Lib\ ECHO ϣ& PAUSE \ No newline at end of file diff --git a/Source/Middleware/AccountServer/Handler/BaseHandler.cs b/Source/Middleware/AccountServer/Handler/BaseHandler.cs index ec73d26a..ba6b1401 100644 --- a/Source/Middleware/AccountServer/Handler/BaseHandler.cs +++ b/Source/Middleware/AccountServer/Handler/BaseHandler.cs @@ -80,7 +80,7 @@ protected string DecodePassword(string password) /// /// /// - protected ResponseData AuthorizeLogin(int userId, string passportId, int userType) + protected ResponseData AuthorizeLogin(long userId, string passportId, int userType) { UserToken userToken = new UserToken() { diff --git a/Source/Middleware/AccountServer/Handler/Login.cs b/Source/Middleware/AccountServer/Handler/Login.cs index 3c9327f8..7de0311e 100644 --- a/Source/Middleware/AccountServer/Handler/Login.cs +++ b/Source/Middleware/AccountServer/Handler/Login.cs @@ -36,7 +36,7 @@ public class Login : BaseHandler, IHandler { public ResponseData Excute(LoginInfo data) { - int userId; + long userId; int userType; string passportId; if (!string.IsNullOrEmpty(data.RetailUser) && !string.IsNullOrEmpty(data.RetailToken)) @@ -49,7 +49,7 @@ public ResponseData Excute(LoginInfo data) if (login.CheckLogin()) { watch.Check("GetResponse"); - userId = int.Parse(login.UserID); + userId = long.Parse(login.UserID); passportId = login.PassportID; userType = login.UserType; } diff --git a/Source/Middleware/AccountServer/Handler/Regist.cs b/Source/Middleware/AccountServer/Handler/Regist.cs index aaa7c216..12ddc4e4 100644 --- a/Source/Middleware/AccountServer/Handler/Regist.cs +++ b/Source/Middleware/AccountServer/Handler/Regist.cs @@ -41,7 +41,7 @@ public ResponseData Excute(LoginInfo data) } data.Pwd = DecodePassword(data.Pwd); int userType; - int userId = SnsManager.QuickRegisterPassport(data.Pid, data.Pwd, data.DeviceID, out userType, data.IsCustom); + var userId = SnsManager.QuickRegisterPassport(data.Pid, data.Pwd, data.DeviceID, out userType, data.IsCustom); if (userId <= 0) { throw new HandlerException(StateCode.Error, StateDescription.RegistError); diff --git a/Source/Middleware/GameServer/Program.cs b/Source/Middleware/GameServer/Program.cs index 35c66e0b..55aad825 100644 --- a/Source/Middleware/GameServer/Program.cs +++ b/Source/Middleware/GameServer/Program.cs @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ using System; +using ZyGames.Framework.Common.Log; using ZyGames.Framework.Game.Runtime; namespace GameServer @@ -31,8 +32,16 @@ class Program { static void Main(string[] args) { - new ConsoleRuntimeHost().Start(); - Console.WriteLine("exited."); + try + { + new ConsoleRuntimeHost().Start(); + Console.WriteLine("exited."); + } + catch (Exception ex) + { + TraceLog.WriteError("Main error:{0}", ex); + Console.Read(); + } } } } diff --git a/Source/Middleware/GameServer/Script/CsScript/Action/Action1001.cs b/Source/Middleware/GameServer/Script/CsScript/Action/Action1001.cs index 7d0954e7..f01046f0 100644 --- a/Source/Middleware/GameServer/Script/CsScript/Action/Action1001.cs +++ b/Source/Middleware/GameServer/Script/CsScript/Action/Action1001.cs @@ -53,7 +53,7 @@ public override void BuildPacket() { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.UserName); - dsItem.PushIntoStack(item.Score); + dsItem.PushIntoStack(item.Score); //Console.WriteLine("Num count:{0}", item.Items.Count); this.PushIntoStack(dsItem); } @@ -84,7 +84,7 @@ private int compareTo(UserRanking x, UserRanking y) int result = y.Score - x.Score; if (result == 0) { - result = y.UserID - x.UserID; + result = y.UserID.CompareTo(x.UserID); } return result; } diff --git a/Source/Middleware/GameServer/Script/Model/GuestUser.cs b/Source/Middleware/GameServer/Script/Model/GuestUser.cs index 578c70e2..6a8ae2f3 100644 --- a/Source/Middleware/GameServer/Script/Model/GuestUser.cs +++ b/Source/Middleware/GameServer/Script/Model/GuestUser.cs @@ -35,7 +35,7 @@ public class GameUser : BaseUser { [ProtoMember(1)] [EntityField(true)] - public int UserId { get; set; } + public long UserId { get; set; } [ProtoMember(2)] [EntityField] @@ -63,12 +63,12 @@ public String RetailId public string SId { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserId; } - - public override int GetUserId() + + public override long GetUserId() { return UserId; } diff --git a/Source/Middleware/GameServer/Script/Model/UserRanking.cs b/Source/Middleware/GameServer/Script/Model/UserRanking.cs index 6d270625..516a5276 100644 --- a/Source/Middleware/GameServer/Script/Model/UserRanking.cs +++ b/Source/Middleware/GameServer/Script/Model/UserRanking.cs @@ -45,7 +45,7 @@ public UserRanking() [ProtoMember(1)] [EntityField(true)] - public int UserID + public long UserID { get; set; @@ -79,7 +79,7 @@ public DateTime CreateDate [EntityField] public CacheList Items { get; set; } - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserID; } diff --git a/Source/Middleware/Solution Items/GlobalAssemblyInfo.cs b/Source/Middleware/Solution Items/GlobalAssemblyInfo.cs index b304e266..2429e6ff 100644 --- a/Source/Middleware/Solution Items/GlobalAssemblyInfo.cs +++ b/Source/Middleware/Solution Items/GlobalAssemblyInfo.cs @@ -32,7 +32,7 @@ THE SOFTWARE. // Revision // // -[assembly: AssemblyVersion("6.7.9.11")] +[assembly: AssemblyVersion("6.7.10.0")] [assembly: AssemblyCompany("scutgame.com")] [assembly: AssemblyProduct("SCUT Server Engine")] [assembly: AssemblyCopyright("Copyright © 2013-2015 Gavin Wu")] diff --git a/Source/Middleware/ZyGames.Framework.Game/Cache/WhisperCacheSet.cs b/Source/Middleware/ZyGames.Framework.Game/Cache/WhisperCacheSet.cs index 9ea0bf49..461cdebc 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Cache/WhisperCacheSet.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Cache/WhisperCacheSet.cs @@ -82,7 +82,7 @@ protected override bool InitCache(List dataList, int periodTime, bo /// /// /// - public void Add(int userId, ChatMessage message) + public void Add(long userId, ChatMessage message) { string groupKey = userId.ToString(); DataContainer.TryAddQueue(groupKey, message, 0, OnExpired); @@ -92,7 +92,7 @@ public void Add(int userId, ChatMessage message) /// /// /// - public bool HasMessage(int userId) + public bool HasMessage(long userId) { string groupKey = userId.ToString(); CacheQueue chatQueue; @@ -106,7 +106,7 @@ public bool HasMessage(int userId) /// /// /// - public ChatMessage[] GetMessage(int userId) + public ChatMessage[] GetMessage(long userId) { string groupKey = userId.ToString(); CacheQueue chatQueue; diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Exam/AbstractExam.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Exam/AbstractExam.cs index 63c04aae..77bbacd6 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Exam/AbstractExam.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Exam/AbstractExam.cs @@ -37,13 +37,13 @@ namespace ZyGames.Framework.Game.Com.Exam /// /// The user identifier. /// - protected readonly int UserId; + protected readonly long UserId; /// /// /// /// - protected AbstractExam(int userId) + protected AbstractExam(long userId) { UserId = userId; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Exam/ExamQuestion.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Exam/ExamQuestion.cs index 9ff2d61a..7f18aa40 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Exam/ExamQuestion.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Exam/ExamQuestion.cs @@ -44,7 +44,7 @@ namespace ZyGames.Framework.Game.Com.Exam /// /// /// - protected ExamQuestion(int userId) + protected ExamQuestion(long userId) : base(userId) { CacheSet = new ConfigCacheSet(); diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/ChannelGift.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/ChannelGift.cs index 9b539b1d..76e89b9c 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/ChannelGift.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/ChannelGift.cs @@ -182,7 +182,7 @@ public string GenerateCardNo(string giftType, string createIp) /// /// /// - public bool Activate(int userId, string cardNo) + public bool Activate(long userId, string cardNo) { string giftType; if (!TryGetGiftType(cardNo, out giftType)) @@ -202,7 +202,7 @@ public bool Activate(int userId, string cardNo) /// User identifier. /// Card no. /// Gift type. - protected abstract void DoActivate(int userId, string cardNo, string giftType); + protected abstract void DoActivate(long userId, string cardNo, string giftType); /// /// 是否已激活 @@ -211,7 +211,7 @@ public bool Activate(int userId, string cardNo) /// /// /// - protected abstract bool HasActivated(int userId, string cardNo, string giftType); + protected abstract bool HasActivated(long userId, string cardNo, string giftType); private bool TryGetGiftType(string cardNo, out string giftType) { diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceCard.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceCard.cs index e10addd2..7e8e0fbd 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceCard.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceCard.cs @@ -36,7 +36,7 @@ public abstract class NoviceCard /// /// The curr user identifier. /// - protected int CurrUserId; + protected long CurrUserId; /// /// The length of the card. /// @@ -45,7 +45,7 @@ public abstract class NoviceCard /// Initializes a new instance of the class. /// /// User identifier. - protected NoviceCard(int userId) + protected NoviceCard(long userId) { CurrUserId = userId; } @@ -87,19 +87,19 @@ protected virtual string GenerateID() /// public bool Activate(string cardId) { - int cardUserId; + long cardUserId; if (!TryGetCardUserId(ref cardId, out cardUserId)) return false; return DoActivateCard(cardId, cardUserId); } - private bool TryGetCardUserId(ref string cardId, out int cardUserId) + private bool TryGetCardUserId(ref string cardId, out long cardUserId) { cardUserId = 0; cardId = cardId ?? ""; cardId = cardId.Trim().Replace('c', 'C'); if (string.IsNullOrEmpty(cardId) || !cardId.StartsWith("C") || - !int.TryParse(cardId.Substring(1), out cardUserId)) + !long.TryParse(cardId.Substring(1), out cardUserId)) { return false; } @@ -111,14 +111,14 @@ private bool TryGetCardUserId(ref string cardId, out int cardUserId) /// true, if activate card was done, false otherwise. /// Card identifier. /// Card user identifier. - protected abstract bool DoActivateCard(string cardId, int cardUserId); + protected abstract bool DoActivateCard(string cardId, long cardUserId); /// /// 领取奖励 /// public bool CheckLvPrize(short userLv, string cardId) { - int cardUserId; + long cardUserId; if (!TryGetCardUserId(ref cardId, out cardUserId)) return false; var prizeLvs = PackagePrizeLv; @@ -138,7 +138,7 @@ public bool CheckLvPrize(short userLv, string cardId) /// Card identifier. /// Card user identifier. /// Lv. - protected abstract void DoPrize(string cardId, int cardUserId, short lv); + protected abstract void DoPrize(string cardId, long cardUserId, short lv); /// /// Determines whether this instance has prize the specified userLv prizeLv. /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceGuide.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceGuide.cs index 82148b4c..d9c2277d 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceGuide.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/NoviceGuide.cs @@ -43,7 +43,7 @@ public abstract class NoviceGuide /// /// The user identifier. /// - protected readonly int UserId; + protected readonly long UserId; private ShareCacheStruct _guideSet; private T _userGuide; @@ -51,7 +51,7 @@ public abstract class NoviceGuide /// /// /// - protected NoviceGuide(int userId) + protected NoviceGuide(long userId) { UserId = userId; _guideSet = new ShareCacheStruct(); diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/PaymentNotify.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/PaymentNotify.cs index cf4d5eb9..5936998f 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Generic/PaymentNotify.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Generic/PaymentNotify.cs @@ -44,7 +44,7 @@ public void Notify(IUser user) { int gameId = GameEnvironment.ProductCode; int serverId = GameEnvironment.ProductServerId; - int userId = user.GetUserId(); + var userId = user.GetUserId(); string pid = user.GetPassportId(); OrderInfo[] orderList = PayManager.getPayment(gameId, serverId, pid); foreach (var orderInfo in orderList) @@ -66,6 +66,6 @@ public void Notify(IUser user) /// /// /// - protected abstract bool DoNotify(int userId, OrderInfo orderInfo); + protected abstract bool DoNotify(long userId, OrderInfo orderInfo); } } \ No newline at end of file diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Model/GiftNoviceCard.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Model/GiftNoviceCard.cs index e9ca624f..5bc41624 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Model/GiftNoviceCard.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Model/GiftNoviceCard.cs @@ -58,7 +58,7 @@ public abstract string GiftType /// Gets or sets the user identifier. /// /// The user identifier. - public abstract int UserId + public abstract long UserId { get; set; diff --git a/Source/Middleware/ZyGames.Framework.Game/Com/Model/UserGuide.cs b/Source/Middleware/ZyGames.Framework.Game/Com/Model/UserGuide.cs index 99b09b24..49ab0cad 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Com/Model/UserGuide.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Com/Model/UserGuide.cs @@ -121,7 +121,7 @@ protected UserGuide() /// /// [ProtoMember(1)] - public abstract Int32 UserId { get; set; } + public abstract long UserId { get; set; } /// /// 是否结束引导 diff --git a/Source/Middleware/ZyGames.Framework.Game/Context/BaseUser.cs b/Source/Middleware/ZyGames.Framework.Game/Context/BaseUser.cs index 571f54e8..ce7a348b 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Context/BaseUser.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Context/BaseUser.cs @@ -81,7 +81,7 @@ public ContextCacheSet UserData /// /// /// - public abstract int GetUserId(); + public abstract long GetUserId(); /// /// /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Context/IUser.cs b/Source/Middleware/ZyGames.Framework.Game/Context/IUser.cs index 736b4c4b..3adf7fa8 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Context/IUser.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Context/IUser.cs @@ -55,7 +55,7 @@ public interface IUser /// get userid /// /// - int GetUserId(); + long GetUserId(); /// /// get passport /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/Action/LoginAction.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/Action/LoginAction.cs index 17eefa50..82d95241 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/Action/LoginAction.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/Action/LoginAction.cs @@ -189,18 +189,13 @@ public override bool TakeAction() PassportId = login.PassportID; UserType = login.UserType; SetParameter(login); - int userId = login.UserID.ToInt(); + var accountId = login.UserID.ToLong(); IUser user; - if (!GetError() && DoSuccess(userId, out user)) + if (!GetError() && DoSuccess(accountId, out user)) { watch.Check("DoSuccess"); - var session = GameSession.Get(Sid); - if (session != null) - { - //user is null in create role. - session.Bind(user ?? new SessionUser() { PassportId = PassportId, UserId = userId }); - return true; - } + OnAuthorized(Sid, user); + return true; } } else @@ -220,6 +215,22 @@ public override bool TakeAction() return false; } + /// + /// 授权用户 + /// + /// + /// + /// + protected void OnAuthorized(string sid, IUser user) + { + var session = GameSession.Get(sid); + if (session != null && user != null) + { + //user is null in create role. + session.Bind(user); + } + } + /// /// /// @@ -251,8 +262,8 @@ protected override bool IsIgnoreUid() /// Dos the success. /// /// true, if success was done, false otherwise. - /// User identifier. + /// User identifier. /// - protected abstract bool DoSuccess(int userId, out IUser user); + protected abstract bool DoSuccess(long accountId, out IUser user); } } \ No newline at end of file diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/ActionDispatcher.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/ActionDispatcher.cs index 0dcb73a0..e569f51c 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/ActionDispatcher.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/ActionDispatcher.cs @@ -239,7 +239,7 @@ protected virtual bool TryBuildPackage(PackageReader packageReader, out RequestP { return false; } - int userId; + long userId; packageReader.TryGetParam("uid", out userId); string sessionId; string proxyId; diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/ActionFactory.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/ActionFactory.cs index 05b47bc7..6d43a81e 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/ActionFactory.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/ActionFactory.cs @@ -213,7 +213,7 @@ public static byte[] GetActionResponse(IActionDispatcher actionDispatcher, int a /// public static RequestPackage GetResponsePackage(int actionId, GameSession session, Parameters parameters, sbyte opCode, object message) { - int userId = session != null ? session.UserId : 0; + var userId = session != null ? session.UserId : 0; string sessionId = session != null ? session.SessionId : ""; var paramList = new Dictionary(StringComparer.InvariantCultureIgnoreCase); diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/GameSession.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/GameSession.cs index 882a3ac4..297eb791 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/GameSession.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/GameSession.cs @@ -79,7 +79,7 @@ public class GameSession #region static member private static ConcurrentDictionary _globalSession; - private static ConcurrentDictionary _userHash; + private static ConcurrentDictionary _userHash; private static ConcurrentDictionary _remoteHash; private static SyncTimer clearTime; private static string sessionRedisKey = "__GLOBAL_SESSIONS"; @@ -92,7 +92,7 @@ static GameSession() clearTime = new SyncTimer(OnClearSession, 6000, 60000); clearTime.Start(); _globalSession = new ConcurrentDictionary(); - _userHash = new ConcurrentDictionary(); + _userHash = new ConcurrentDictionary(); _remoteHash = new ConcurrentDictionary(); LoadUnLineData(); } @@ -122,7 +122,7 @@ private static void LoadUnLineData() var session = new GameSession(sessionId, null) { LastActivityTime = user.OnlineDate }; _globalSession[sessionId] = session; - int userId = user.GetUserId(); + var userId = user.GetUserId(); GameSession oldsession; Guid sid; if (_userHash.TryGetValue(userId, out sid) && @@ -390,13 +390,13 @@ public static void Recover(GameSession session, Guid newSessionKey, ExSocket soc /// /// /// - public static GameSession Get(int userId) + public static GameSession Get(long userId) { Guid val; return _userHash.TryGetValue(userId, out val) ? Get(val) : null; } - internal static Guid GetUserBindSid(int userId) + internal static Guid GetUserBindSid(long userId) { Guid val; if (_userHash.TryGetValue(userId, out val)) @@ -660,7 +660,7 @@ public bool IsReplaced /// login UserId /// [JsonIgnore] - public int UserId { get { return User != null ? User.GetUserId() : 0; } } + public long UserId { get { return User != null ? User.GetUserId() : 0; } } /// /// User @@ -820,7 +820,7 @@ public void SetExpired() public void Bind(IUser user) { if (user == null) return; - int userId = user.GetUserId(); + var userId = user.GetUserId(); if (userId > 0) { //解除UserId与前一次的Session连接对象绑定 diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/HttpGet.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/HttpGet.cs index 6e38f9e7..56d22092 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/HttpGet.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/HttpGet.cs @@ -162,7 +162,7 @@ public int ActionId { get { return _actionId; } } - + private string _paramString; /// @@ -258,6 +258,24 @@ public override string ToParamString() { return ParamString; } + /// + /// + /// + /// + /// + /// + /// + /// + public override ulong GetLongValue(string param, ulong min, ulong max, bool isRequired = true) + { + ulong value = 0; + if (!GetLong(param, ref value, min, max) && isRequired) + { + throw new ArgumentOutOfRangeException("param", string.Format("{0} value out of range[{1}-{2}]", param, min, max)); + } + return value; + } + /// /// /// @@ -468,6 +486,29 @@ public override bool Contains(string param) WriteContainsError(param); return false; } + + public override bool GetLong(string aName, ref ulong rValue, ulong minValue = 0, ulong maxValue = ulong.MaxValue) + { + bool result = false; + if (_param.ContainsKey(aName)) + { + result = ulong.TryParse(_param[aName], out rValue); + if (result) + { + result = rValue >= minValue && rValue <= maxValue; + } + if (!result) + { + WriteRangOutError(aName, minValue, maxValue); + } + } + else + { + WriteContainsError(aName); + } + return result; + } + /// /// /// @@ -819,6 +860,14 @@ private void WriteContainsError(string param) _error.AppendFormat(Language.Instance.UrlNoParam, param); } + private void WriteRangOutError(string param, ulong min, ulong max) + { + if (_error.Length > 0) + { + _error.Append(","); + } + _error.AppendFormat(Language.Instance.UrlParamOutRange, param, min, max); + } private void WriteRangOutError(string param, long min, long max) { if (_error.Length > 0) @@ -854,7 +903,7 @@ public override int GetActionId() /// /// /// - public override int GetUserId() + public override long GetUserId() { return Session != null ? Session.UserId : 0; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/PackageReader.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/PackageReader.cs index 396e8855..a4a71879 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/PackageReader.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/PackageReader.cs @@ -150,6 +150,23 @@ public bool TryGetParam(string name, out int value) } return false; } + /// + /// + /// + /// + /// + /// + public bool TryGetParam(string name, out long value) + { + value = 0; + string str; + if (TryGetParam(name, out str)) + { + value = str.ToLong(); + return true; + } + return false; + } /// /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/RemoteService.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/RemoteService.cs index eb13f20f..84f0c673 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/RemoteService.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/RemoteService.cs @@ -173,7 +173,7 @@ private static void OnNetHttpCallback(object sender, RemoteEventArgs e) private readonly RemoteClient _client; private int _msgId; private string _sessionId = ""; - private int _userId = 0; + private long _userId = 0; private string _proxySessionId = ""; private DictionaryExtend _packagePools; /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/RequestPackage.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/RequestPackage.cs index 1f5649d1..fe52d993 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/RequestPackage.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/RequestPackage.cs @@ -45,7 +45,7 @@ public RequestPackage() /// /// init /// - public RequestPackage(int msgId, string sessionId, int actionId, int userId, ProtocolVersion ptcl = ProtocolVersion.Default) + public RequestPackage(int msgId, string sessionId, int actionId, long userId, ProtocolVersion ptcl = ProtocolVersion.Default) { MsgId = msgId; SessionId = sessionId; @@ -86,7 +86,7 @@ public RequestPackage(int msgId, string sessionId, int actionId, int userId, Pro /// session id of client /// [ProtoMember(5)] - public int UserId { get; protected set; } + public long UserId { get; protected set; } /// /// is proxy server connect diff --git a/Source/Middleware/ZyGames.Framework.Game/Contract/SessionUser.cs b/Source/Middleware/ZyGames.Framework.Game/Contract/SessionUser.cs index 9fe09d4d..b9eeb4ba 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Contract/SessionUser.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Contract/SessionUser.cs @@ -70,7 +70,7 @@ public SessionUser(BaseUser roleUser) /// /// [ProtoMember(3)] - public int UserId { get; set; } + public long UserId { get; set; } /// /// @@ -100,7 +100,7 @@ public SessionUser(BaseUser roleUser) /// /// /// - public int GetUserId() + public long GetUserId() { return UserId; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Message/ChatMessage.cs b/Source/Middleware/ZyGames.Framework.Game/Message/ChatMessage.cs index d53fe11a..71d5b4cb 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Message/ChatMessage.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Message/ChatMessage.cs @@ -60,19 +60,19 @@ public ChatMessage() /// 发送人 /// [ProtoMember(1004)] - public virtual int FromUserID { get; set; } + public virtual long FromUserID { get; set; } /// /// 接收人 /// [ProtoMember(1005)] - public virtual int ToUserID { get; set; } + public virtual long ToUserID { get; set; } /// /// Gets the identity identifier. /// /// The identity identifier. - protected override int GetIdentityId() + protected override long GetIdentityId() { return DefIdentityId; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Message/ChatService.cs b/Source/Middleware/ZyGames.Framework.Game/Message/ChatService.cs index 2f983526..a4793af7 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Message/ChatService.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Message/ChatService.cs @@ -35,7 +35,7 @@ namespace ZyGames.Framework.Game.Message /// public abstract class ChatService { - private readonly int _userId; + private readonly long _userId; private readonly ChatCacheSet _chatCacheSet; private readonly WhisperCacheSet _whisperCacheSet; private static readonly VersionConfig VersionSet = new VersionConfig(); @@ -54,7 +54,7 @@ public static int NextVersion /// Initializes a new instance of the class. /// /// User identifier. - protected ChatService(int userId) + protected ChatService(long userId) { _userId = userId; _chatCacheSet = new ChatCacheSet(); @@ -154,7 +154,7 @@ public List PublicReceive() /// /// The receive. /// User identifier. - public List UserReceive(int userId) + public List UserReceive(long userId) { List list = new List(); var whisperMessages = _whisperCacheSet.GetMessage(userId); diff --git a/Source/Middleware/ZyGames.Framework.Game/Message/MailMessage.cs b/Source/Middleware/ZyGames.Framework.Game/Message/MailMessage.cs index 771ad070..c6377959 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Message/MailMessage.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Message/MailMessage.cs @@ -78,13 +78,13 @@ public virtual Guid MailID /// /// The _ user identifier. /// - protected Int32 _UserId; + protected long _UserId; /// /// [ProtoMember(2)] [EntityFieldExtend] [EntityField(true)] - public virtual Int32 UserId + public virtual long UserId { get { @@ -118,13 +118,13 @@ public virtual Int32 MailType /// /// The _ from user identifier. /// - protected Int32 _FromUserId; + protected long _FromUserId; /// /// [ProtoMember(4)] [EntityFieldExtend] [EntityField] - public virtual Int32 FromUserId + public virtual long FromUserId { get { @@ -158,13 +158,13 @@ public virtual String FromUserName /// /// The _ to user I. /// - protected Int32 _ToUserID; + protected long _ToUserID; /// /// [ProtoMember(6)] [EntityFieldExtend] [EntityField] - public virtual Int32 ToUserID + public virtual long ToUserID { get { @@ -399,7 +399,7 @@ protected override object this[string index] /// Gets the identity identifier. /// /// The identity identifier. - protected override int GetIdentityId() + protected override long GetIdentityId() { return UserId; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Message/NoticeMessage.cs b/Source/Middleware/ZyGames.Framework.Game/Message/NoticeMessage.cs index c2aa08c1..1d23532d 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Message/NoticeMessage.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Message/NoticeMessage.cs @@ -157,7 +157,7 @@ public virtual DateTime SendDate /// Gets the identity identifier. /// /// The identity identifier. - protected override int GetIdentityId() + protected override long GetIdentityId() { return DefIdentityId; } diff --git a/Source/Middleware/ZyGames.Framework.Game/Service/ActionGetter.cs b/Source/Middleware/ZyGames.Framework.Game/Service/ActionGetter.cs index 1e1ced0e..8d09a6f6 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Service/ActionGetter.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Service/ActionGetter.cs @@ -113,7 +113,7 @@ public virtual string GetRouteName() /// /// get current UserId. /// - public virtual int GetUserId() + public virtual long GetUserId() { return ReqPackage.UserId; } @@ -200,6 +200,19 @@ public virtual string this[string key] get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } + + /// + /// + /// + /// + /// + /// + /// + /// + public virtual ulong GetLongValue(string param, ulong min, ulong max, bool isRequired = true) + { + throw new NotImplementedException(); + } /// /// /// @@ -335,11 +348,15 @@ public virtual bool Contains(string param) /// /// /// - public virtual bool GetInt(string aName, ref Int32 rValue) + /// + /// + /// + /// + /// + public virtual bool GetLong(string aName, ref ulong rValue, ulong minValue = 0, ulong maxValue = ulong.MaxValue) { throw new NotImplementedException(); } - /// /// /// @@ -348,6 +365,14 @@ public virtual bool GetLong(string aName, ref long rValue, long minValue = 0, lo throw new NotImplementedException(); } + /// + /// + /// + public virtual bool GetInt(string aName, ref Int32 rValue) + { + throw new NotImplementedException(); + } + /// /// /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Service/GameStruct.cs b/Source/Middleware/ZyGames.Framework.Game/Service/GameStruct.cs index c7ec9cd1..1361d3c5 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Service/GameStruct.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Service/GameStruct.cs @@ -99,7 +99,7 @@ public enum LogActionStat /// /// /// - public int UserId + public long UserId { get { diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/HandlerManager.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/HandlerManager.cs index dd775a0b..9538ccb2 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/HandlerManager.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/HandlerManager.cs @@ -60,7 +60,7 @@ public static class HandlerManager public static int RedisDb; private static Dictionary handlerTypes; private static ConcurrentDictionary userTokenCache = new ConcurrentDictionary(); - private static ConcurrentDictionary userHashCache = new ConcurrentDictionary(); + private static ConcurrentDictionary userHashCache = new ConcurrentDictionary(); private static bool RedisConnected; static HandlerManager() diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/LoginToken.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/LoginToken.cs index 55f425ee..93b8b29c 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/LoginToken.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/LoginToken.cs @@ -39,7 +39,7 @@ public class LoginToken : ResponseData /// /// /// - public int UserId { get; set; } + public long UserId { get; set; } /// /// @@ -51,6 +51,6 @@ public class LoginToken : ResponseData public bool IsGuest { get { return UserType == (int) RegType.Guest; } - } + } } } \ No newline at end of file diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/UserToken.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/UserToken.cs index 2b138d14..3ded6518 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/Service/UserToken.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/Service/UserToken.cs @@ -37,7 +37,7 @@ public class UserToken /// /// /// - public int UserId { get; set; } + public long UserId { get; set; } /// /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsCenterUser.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsCenterUser.cs index 85767084..811c392f 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsCenterUser.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsCenterUser.cs @@ -88,12 +88,12 @@ public static string PasswordEncryptMd5(string str) /// 官网渠道ID /// private const string SysetmRetailID = "0000"; - private int _userid; + private long _userid; /// /// 获得用户ID /// /// - public int UserId { get { return _userid; } } + public long UserId { get { return _userid; } } private string _PassportId = String.Empty; private string _PassportPwd = String.Empty; private string _imei = String.Empty; @@ -232,7 +232,7 @@ public SnsUser GetUserByDeviceId(string imei) /// Parameter names. /// Parameter values. /// - public int InsertSnsUser(string[] paramNames, string[] paramValues, bool isCustom) + public long InsertSnsUser(string[] paramNames, string[] paramValues, bool isCustom) { SnsPassport oSnsPassportLog = new SnsPassport(); if (!isCustom && !oSnsPassportLog.VerifyRegPassportId(_PassportId)) @@ -272,7 +272,7 @@ public int InsertSnsUser(string[] paramNames, string[] paramValues, bool isCusto { if (aReader.Read()) { - _userid = Convert.ToInt32(aReader[0]); + _userid = Convert.ToInt64(aReader[0]); } } return _userid; @@ -287,7 +287,7 @@ public int InsertSnsUser(string[] paramNames, string[] paramValues, bool isCusto /// 向社区中心添加用户 /// /// - public int InsertSnsUser(bool isCustom) + public long InsertSnsUser(bool isCustom) { return InsertSnsUser(new string[0], new string[0], isCustom); } @@ -471,7 +471,7 @@ private void SetUserInfo(Action match, SnsUser snsUser) { if (aReader.Read()) { - snsUser.UserId = Convert.ToInt32(aReader["UserId"]); + snsUser.UserId = Convert.ToInt64(aReader["UserId"]); snsUser.IMEI = Convert.ToString(aReader["DeviceID"]); snsUser.PassportId = Convert.ToString(aReader["PassportID"]); snsUser.Password = Convert.ToString(aReader["PassportPwd"]); diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsManager.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsManager.cs index df79ca4c..ea597c84 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsManager.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsManager.cs @@ -177,7 +177,7 @@ public static int RegisterWeixin(string pid, string password, string imei, strin /// /// use custom passport /// userid - public static int QuickRegisterPassport(string passportId, string password, string imei, bool isCustom = false) + public static long QuickRegisterPassport(string passportId, string password, string imei, bool isCustom = false) { int userType; return QuickRegisterPassport(passportId, password, imei, out userType, isCustom); @@ -192,7 +192,7 @@ public static int QuickRegisterPassport(string passportId, string password, stri /// /// /// - public static int QuickRegisterPassport(string passportId, string password, string imei, out int userType, bool isCustom = false) + public static long QuickRegisterPassport(string passportId, string password, string imei, out int userType, bool isCustom = false) { return DoRegisterPassport(passportId, password, imei, null, null, out userType, isCustom); } @@ -213,7 +213,7 @@ public static string RegisterPassport(string password, string imei, string[] par return pid; } - private static int DoRegisterPassport(string passportId, string password, string imei, string[] paramNames, string[] paramValues, out int userType, bool isCustom) + private static long DoRegisterPassport(string passportId, string password, string imei, string[] paramNames, string[] paramValues, out int userType, bool isCustom) { SnsCenterUser snsCenterUser = new SnsCenterUser(passportId, password, imei); var snsuser = snsCenterUser.GetUserInfo(passportId); @@ -233,7 +233,7 @@ private static int DoRegisterPassport(string passportId, string password, string /// /// use custom passport /// - public static int Login(string user, string password, bool isCustom = false) + public static long Login(string user, string password, bool isCustom = false) { return LoginByDevice(user, password, string.Empty, isCustom); } @@ -246,7 +246,7 @@ public static int Login(string user, string password, bool isCustom = false) /// /// use custom passport /// - public static int LoginByDevice(string user, string password, string imei, bool isCustom = false) + public static long LoginByDevice(string user, string password, string imei, bool isCustom = false) { RegType userType; return LoginByDevice(user, password, imei, out userType, isCustom); @@ -261,11 +261,11 @@ public static int LoginByDevice(string user, string password, string imei, bool /// /// use custom passport /// - public static int LoginByDevice(string user, string password, string imei, out RegType userType, bool isCustom = false) + public static long LoginByDevice(string user, string password, string imei, out RegType userType, bool isCustom = false) { if (!SnsCenterUser.CheckDevice(imei)) throw (new Exception("禁止登录")); - int userId = 0; + long userId = 0; try { var snsCenterUser = new SnsCenterUser(user, password, imei); diff --git a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsUser.cs b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsUser.cs index 4633d907..d0bae53f 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Sns/SnsUser.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Sns/SnsUser.cs @@ -48,7 +48,7 @@ public string WeixinCode /// /// /// - public int UserId + public long UserId { get; set; diff --git a/Source/Middleware/ZyGames.Framework.Game/Task/ITaskItem.cs b/Source/Middleware/ZyGames.Framework.Game/Task/ITaskItem.cs index 0df5cde3..dad8145b 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Task/ITaskItem.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Task/ITaskItem.cs @@ -67,7 +67,7 @@ public interface ITaskItem /// Gets or sets the user I. /// /// The user I. - int UserID { get; set; } + long UserID { get; set; } /// /// Gets or sets the task I. /// diff --git a/Source/Middleware/ZyGames.Framework.Game/Task/TaskService.cs b/Source/Middleware/ZyGames.Framework.Game/Task/TaskService.cs index 8649d7d7..acb34234 100644 --- a/Source/Middleware/ZyGames.Framework.Game/Task/TaskService.cs +++ b/Source/Middleware/ZyGames.Framework.Game/Task/TaskService.cs @@ -52,14 +52,14 @@ public class TaskService /// /// The user identifier. /// - protected readonly int UserId; + protected readonly long UserId; private dynamic _taskScope; private bool _isUsedPy; /// /// /// /// - public TaskService(int userId) + public TaskService(long userId) { UserId = userId; _isUsedPy = InitTask(); diff --git "a/Source/Middleware/\345\217\221\345\270\203\345\244\204\347\220\206.bat" "b/Source/Middleware/\345\217\221\345\270\203\345\244\204\347\220\206.bat" index 9e006729..703cf50f 100644 --- "a/Source/Middleware/\345\217\221\345\270\203\345\244\204\347\220\206.bat" +++ "b/Source/Middleware/\345\217\221\345\270\203\345\244\204\347\220\206.bat" @@ -1,9 +1,9 @@ @echo off -xcopy /y ZyGames.Framework.Game\bin\ZyGames.Framework.Game.* ..\..\Release\6.7.9.11\Lib\ /EXCLUDE:copyfilter.txt -xcopy /y ScutSecurity\bin\*.dll ..\..\Release\6.7.9.11\Lib\ /EXCLUDE:copyfilter.txt +xcopy /y ZyGames.Framework.Game\bin\ZyGames.Framework.Game.* ..\..\Release\6.7.10.0\Lib\ /EXCLUDE:copyfilter.txt +xcopy /y ScutSecurity\bin\*.dll ..\..\Release\6.7.10.0\Lib\ /EXCLUDE:copyfilter.txt -xcopy /y GameServer\bin\GameServer.* ..\..\Release\6.7.9.11\Console\ /EXCLUDE:copyfilter.txt -xcopy /y GameServer\bin\RNLog.config ..\..\Release\6.7.9.11\Console\ -xcopy /y /s GameServer\Script\*.* ..\..\Release\6.7.9.11\Console\Script\ +xcopy /y GameServer\bin\GameServer.* ..\..\Release\6.7.10.0\Console\ /EXCLUDE:copyfilter.txt +xcopy /y GameServer\bin\RNLog.config ..\..\Release\6.7.10.0\Console\ +xcopy /y /s GameServer\Script\*.* ..\..\Release\6.7.10.0\Console\Script\ ECHO ϣ& PAUSE \ No newline at end of file diff --git a/readme.md b/readme.md index 82fbfb0b..939c97ad 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # README -[![Build Status](http://scutgame.com/images/passing.png?branch=6.7.9.11)](http://scutgame.com/download/) +[![Build Status](http://scutgame.com/images/passing.png?branch=6.7.10.0)](http://scutgame.com/download/) ## What's Scut? @@ -111,12 +111,9 @@ Language: ## Update Log -### Version: 6.7.9.11 (2015-12-17) Beta - -* Add Redis & DB sync queue profile log. -* Fixed Sql command bug. -* Fixed socket send bug. +### Version: 6.7.10.0 (2015-12-17) alpha +* Fixed use long type of userId. old version [more](http://scutgame.com/log).