/* Sog 游戏基础库 2016 by zouwei */ using System; using System.IO; using ProtoCSStruct; using Sog; namespace Version { public static class VersionServerUtils { public static ProtoCSStructPacker GetProtoPacker() { return ProtoPackerFactory.Instance.GetProtoCSStructPacker(); } public static VersionServerData GetVersionServerData() { return ServerDataObjMgr.GetDataObj(VersionDataObjType.VersionServerData); } public static StructPacketSender GetPacketSender() { return GetVersionServerData().m_packetSender; } public static ServerApp GetApp() { return GetVersionServerData().m_app; } public static long GetTimeSecond() { return GetVersionServerData().m_app.Time.GetTimeSecond(); } /// /// 获取服务器配置方法 /// public static VersionServerConfig GetServerConfig() { return (VersionServerConfig)ServerConfigMgr.Instance.m_serverConfig; } public static string GetLangAbbrFromOsLanguage(string os_lang) { if(os_lang == "ChineseSimplified") { return "zh"; } else if(os_lang == "ChineseTraditional") { return "zh_tw"; } else if(os_lang == "German") { return "de"; } else if (os_lang == "French") { return "fr"; } else if (os_lang == "Italian") //意大利语 { return "it"; } else if (os_lang == "Portuguese") // 葡萄牙 { return "pt"; } else if (os_lang == "Spanish") //西班牙 { return "es"; } else if (os_lang == "Russian") { return "rus"; } else if (os_lang == "Indonesian") // 印尼 { return "id"; } else if (os_lang == "Thai") //泰语 { return "th"; } //缺省,都是英语 return "en"; /* public enum SystemLanguage { /// /// Afrikaans. /// Afrikaans = 0, /// /// Arabic. /// Arabic = 1, /// /// Basque. /// Basque = 2, /// /// Belarusian. /// Belarusian = 3, /// /// Bulgarian. /// Bulgarian = 4, /// /// Catalan. /// Catalan = 5, /// /// Chinese. /// Chinese = 6, /// /// Czech. /// Czech = 7, /// /// Danish. /// Danish = 8, /// /// Dutch. /// Dutch = 9, /// /// English. /// English = 10, // 0x0000000A /// /// Estonian. /// Estonian = 11, // 0x0000000B /// /// Faroese. /// Faroese = 12, // 0x0000000C /// /// Finnish. /// Finnish = 13, // 0x0000000D /// /// French. /// French = 14, // 0x0000000E /// /// German. /// German = 15, // 0x0000000F /// /// Greek. /// Greek = 16, // 0x00000010 /// /// Hebrew. /// Hebrew = 17, // 0x00000011 [Obsolete("Use SystemLanguage.Hungarian instead (UnityUpgradable) -> Hungarian", true)] Hugarian = 18, // 0x00000012 /// /// Hungarian. /// Hungarian = 18, // 0x00000012 /// /// Icelandic. /// Icelandic = 19, // 0x00000013 /// /// Indonesian. /// Indonesian = 20, // 0x00000014 /// /// Italian. /// Italian = 21, // 0x00000015 /// /// Japanese. /// Japanese = 22, // 0x00000016 /// /// Korean. /// Korean = 23, // 0x00000017 /// /// Latvian. /// Latvian = 24, // 0x00000018 /// /// Lithuanian. /// Lithuanian = 25, // 0x00000019 /// /// Norwegian. /// Norwegian = 26, // 0x0000001A /// /// Polish. /// Polish = 27, // 0x0000001B /// /// Portuguese. /// Portuguese = 28, // 0x0000001C /// /// Romanian. /// Romanian = 29, // 0x0000001D /// /// Russian. /// Russian = 30, // 0x0000001E /// /// Serbo-Croatian. /// SerboCroatian = 31, // 0x0000001F /// /// Slovak. /// Slovak = 32, // 0x00000020 /// /// Slovenian. /// Slovenian = 33, // 0x00000021 /// /// Spanish. /// Spanish = 34, // 0x00000022 /// /// Swedish. /// Swedish = 35, // 0x00000023 /// /// Thai. /// Thai = 36, // 0x00000024 /// /// Turkish. /// Turkish = 37, // 0x00000025 /// /// Ukrainian. /// Ukrainian = 38, // 0x00000026 /// /// Vietnamese. /// Vietnamese = 39, // 0x00000027 /// /// ChineseSimplified. /// ChineseSimplified = 40, // 0x00000028 /// /// ChineseTraditional. /// ChineseTraditional = 41, // 0x00000029 /// /// Unknown. /// Unknown = 42, // 0x0000002A }*/ } } }