Comments (11)
I figured out what the problem is, I try to pass a "char" when "SendMsg" takes a String, but I still can't figure out how to create my own structures in NFDefine.proto and use them.
Can you help?
Im try use converter char to string, but NF accept structure, it's not correct method, need use NFDefine.proto structures, but i don't know how create NFDefine.proto for my game
from noahgameframe.
If I'm not mistaken, I need to edit NFDefine.proto to fit my settings, however, I don't want to use protobuf. How to use NFDefine.proto without using protobuf to transfer a packet in m_pNetModule->SendMsg?
from noahgameframe.
Everything, I figured it out!
These .proto files are needed if you use "protobuf", if you don’t, need protobuf, simply convert char to string indicating the length of the string during the conversion, otherwise it will interpret the value of zeros as the end of the string.
from noahgameframe.
Hello, im try use NF for my game.
Im not understand how use "NFMsg" in callback, he use protobuf, but me need use defualt method, without protobuf. And how create NFMsg for my packets in .proto files? And where he taked NFMsg set_event_code and set__... comands?After failure im try create my array, not use NFMsg (.proto) files
i'm create "char xMsg[1024]", push array bytes for test and try send on serve useBytes in xMsg "00 00 00 04 00 00 00 02 00 00 00 08"
m_pNetModule->SendMsg(3, xMsg, nSockIndex);
But, in SendMsg function the array xMsg is nulled, why?
SendMsg function correct read аirst arg - OpCode, but the second transmitted incorrectly.
You can pass the parameter with string and PB object for transferring to the client.
BTW, the "send" function signature show as below:
virtual bool SendMsg(const uint16_t nMsgID, const std::string& xData, const NFSOCK nSockIndex);
The best way to send message success is to pass the parameter with std::string.
from noahgameframe.
I figured out what the problem is, I try to pass a "char" when "SendMsg" takes a String, but I still can't figure out how to create my own structures in NFDefine.proto and use them.
Can you help?
Im try use converter char to string, but NF accept structure, it's not correct method, need use NFDefine.proto structures, but i don't know how create NFDefine.proto for my game
You would have a look about how to use protocol-buf.
from noahgameframe.
If I'm not mistaken, I need to edit NFDefine.proto to fit my settings, however, I don't want to use protobuf. How to use NFDefine.proto without using protobuf to transfer a packet in m_pNetModule->SendMsg?
Yes, you can use SendMsg function without protobuf, just using std::string instead of using protobuf.
from noahgameframe.
I liked the NF, I was able to master it in 2 days. It is a pity that there is little documentation.
Are you the only one who is currently developing NF?
By the way, I wanted to clarify something:
My game uses packet serialization, for example, we have 2 opcodes: 10, 22, which are responsible for health and movement. On the client side, these 2 separate packets can be packaged in 1 packetin the format: Lenght, MsgID(10), Data, Lenght, MsgID(22), Data
As you can see from the example above, one packet that comes from the client to the server will have 2 opcodes in it at once.
Can NF parse such packet? For example, comparing the packet length from "Recv" with the length from the packet header.
For example AllLenght is the length of the entire packet obtained from libevent, but the packet itself contains two more lengths: Lenght for the first opcode (10) and Lenght for the second opcode ( 22), and NF checks that if if (Lenght <AllLenght), then it parses the data again, however, based on the length of the data from the first opcode (it's for get the next data from packet)
from noahgameframe.
By the way, how to add your own xml files to the "Ini" folder? They are not initialized when I try to get it through
NF_SHARE_PTR <NFIClass> xLogicClass = m_pClassModule-> GetElement (NFrame :: World :: ThisName ());
It gives an error that the file was not found inside the "mObjectList"
How to add my .xml to "mObjectList" and after use ?
(I created the .xml file and placed it in the "Ini" folder, I could not mistake the names)
I mean, how to Load my .xml to mObjectList
from noahgameframe.
By the way, how to add your own xml files to the "Ini" folder? They are not initialized when I try to get it through
NF_SHARE_PTR <NFIClass> xLogicClass = m_pClassModule-> GetElement (NFrame :: World :: ThisName ());
It gives an error that the file was not found inside the "mObjectList"
How to add my .xml to "mObjectList" and after use ?
(I created the .xml file and placed it in the "Ini" folder, I could not mistake the names)I mean, how to Load my .xml to mObjectList
You would add an excel file in NF's world if you want to add you .xml file, the reason is NF can export the excel file as .xml file automatically.
from noahgameframe.
By the way, how to add your own xml files to the "Ini" folder? They are not initialized when I try to get it through
NF_SHARE_PTR <NFIClass> xLogicClass = m_pClassModule-> GetElement (NFrame :: World :: ThisName ());
It gives an error that the file was not found inside the "mObjectList"
How to add my .xml to "mObjectList" and after use ?
(I created the .xml file and placed it in the "Ini" folder, I could not mistake the names)
I mean, how to Load my .xml to mObjectListYou would add an excel file in NF's world if you want to add you .xml file, the reason is NF can export the excel file as .xml file automatically.
But im not use World server, im change server architecture and use Login and Proxy server for Auth and MSG, i'm want add my .xml for Login and Proxy server.
I was also interested above about whether NF can parse data serialization (my question is two answers above)
from noahgameframe.
All the servers(included Login and Proxy) must load the .xml file that exported from excel file, so you can add your .xml by adding excel file.
from noahgameframe.
Related Issues (20)
- Where can I find / place matchmaker plugin? HOT 4
- CUP 占用率异常 HOT 2
- NFWSModule::AddReceiveCallBack 绑定的pb消息回调无法触发 HOT 2
- Not building for Windows HOT 2
- Cant run cmake.... HOT 7
- 有没有打算做一个UE4的客户端 HOT 1
- does this wonderful framework support seemless big world like wow? HOT 1
- Compile error in dev studio 2019 HOT 2
- vs2019 编译错误 HOT 2
- VS2019 can't build with lua error HOT 4
- Make a game like bomberman clone HOT 3
- 祝安好! 好走!
- 一切安康,好走,天堂上有美丽的大海,有你梦想中的小船。 HOT 7
- God wanted to understand this framework, so he was invited
- 2021.7.9 在新西兰奥克兰的一场车祸中,ketoo 永远离开了我们。 HOT 2
- 走好,RIP。 逝者已矣,生者如斯,目前已发起对Ketoo家庭的援助,望大家伸出援手。Donations is needed to support Ketoo's family. HOT 9
- Anybody will continue Ketoo's work on "blueprint" Branch? HOT 1
- How to add a new project in NFExamples folder? HOT 2
- 这个框架当前还维护么? HOT 2
- 逻辑线程是单线程的情况下,io建议考虑使用非阻塞来提高吞吐量
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noahgameframe.