diff --git a/src/lua/test/pb.lua b/src/lua/test/pb.lua index 16a8f9c9..f766cc05 100644 --- a/src/lua/test/pb.lua +++ b/src/lua/test/pb.lua @@ -23,4 +23,13 @@ function Test1() PrintTable(test_tbl); end -Test1() \ No newline at end of file +function Test2() + print("create a blank proto struct to lua table") + local test_tbl = Squick:GetProtoTable("rpc.PlayerData") + PrintTable(test_tbl) + print("Json encode:") + print(Json.encode(test_tbl)) +end + +--Test1() +Test2() diff --git a/src/proto/base.proto b/src/proto/base.proto index 27d0b48d..2a567b59 100644 --- a/src/proto/base.proto +++ b/src/proto/base.proto @@ -26,6 +26,7 @@ enum ErrorCode { ErrCommonFaild = 1; } + message PlayerData { string account = 1; string account_id = 2; @@ -38,4 +39,4 @@ message PlayerData { int32 last_login_time = 9; int32 last_offline_time = 10; string platform = 11; -} \ No newline at end of file +} diff --git a/src/proto/db_table.proto b/src/proto/db_table.proto new file mode 100644 index 00000000..e82fb594 --- /dev/null +++ b/src/proto/db_table.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package rpc; +import "base.proto"; + +message OnlineTable { + int64 uid = 1; +} + +message PlayerTable { + int64 uid = 1; // index + PlayerData data = 2; +} diff --git a/src/proto/n_cklog.proto b/src/proto/n_cklog.proto new file mode 100644 index 00000000..4cdcad19 --- /dev/null +++ b/src/proto/n_cklog.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package rpc; +import "base.proto"; + +// CKLog +message NCkLogPlayerLogin { // msg_id=52000; + int32 login_time = 1; +} + diff --git a/src/proto/n_db_proxy.proto b/src/proto/n_db_proxy.proto index fce469e6..16f1a61d 100644 --- a/src/proto/n_db_proxy.proto +++ b/src/proto/n_db_proxy.proto @@ -288,4 +288,4 @@ message NAckMysqlUpdate { // msg_id=30307; int32 code = 1; bytes msg = 2; int32 query_id = 3; -} \ No newline at end of file +} diff --git a/src/proto/n_db_table.proto b/src/proto/n_db_table.proto deleted file mode 100644 index e5ea9854..00000000 --- a/src/proto/n_db_table.proto +++ /dev/null @@ -1,20 +0,0 @@ -// Desc: MongoDb table -syntax = "proto3"; -package rpc; -import "base.proto"; - -message OnlineTable { - bool is_online = 1; - int32 node_player = 2; - int32 node_proxy = 3; - int32 node_world = 4; - int32 node_room = 5; - int32 node_game = 6; -} - -message PlayerTable { - PlayerData data = 1; -} - -message FriendTable { -} \ No newline at end of file diff --git a/src/proto/readme.md b/src/proto/readme.md index f965d183..bfa0667f 100644 --- a/src/proto/readme.md +++ b/src/proto/readme.md @@ -20,4 +20,6 @@ 45000 ~ 46000 : game_manager.proto -50000 ~ 50200 : test.proto \ No newline at end of file +50000 ~ 50200 : test.proto + +52000 - 62000 : cklog.proto