Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

로직레이어에서 프로토콜 버퍼의 추가는 안되는건가요? #49

Open
woodrockman opened this issue Jan 24, 2016 · 7 comments

Comments

@woodrockman
Copy link

SFPacketStore.proto 에서 messege를 추가하고
cc, h파일을 만든 결과, 새로 만든 messege만 찾을 수 없다고 나옵니다! ㅠㅠ...
(직접 정의탐색을 할 경우 cc, h 내용들 다 있었습니다.)

그리고 원래 있던 Login 내부의 메세지 구조를 바꿔서 테스트 한 결과
이쪽은 잘 적용이 된 것을 확인했습니다.

로직레이어쪽에서 프로토콜 버퍼의 메세지를 추가할 수는 없는걸까요?

오류 5 error LNK2019: "public: void __thiscall SFPacketStore::PlayerInfo::CopyFrom(class SFPacketStore::PlayerInfo const &)" (?CopyFrom@PlayerInfo@SFPacketStore@@QAEXABV12@@z) 외부 기호(참조 위치: "public: class SFPacketStore::PlayerInfo & __thiscall SFPacketStore::PlayerInfo::operator=(class SFPacketStore::PlayerInfo const &)" (??4PlayerInfo@SFPacketStore@@QAEAAV01@ABV01@@z) 함수)에서 확인하지 못했습니다. Sample\SevenGameServer\CasualGame.lib(SFCGProtobufProtocol.obj) SevenGameServer
오류 3 error LNK2019: "public: virtual __thiscall SFPacketStore::PlayerInfo::~PlayerInfo(void)" (??1PlayerInfo@SFPacketStore@@UAE@XZ) 외부 기호(참조 위치: "public: virtual __thiscall SFProtobufPacket::~SFProtobufPacket(void)" (??1?$SFProtobufPacket@VPlayerInfo@SFPacketStore@@@@UAE@XZ) 함수)에서 확인하지 못했습니다. Sample\SevenGameServer\CasualGame.lib(SFCGProtobufProtocol.obj) SevenGameServer
오류 1 error LNK2019: "public: __thiscall SFPacketStore::PlayerInfo::PlayerInfo(void)" (??0PlayerInfo@SFPacketStore@@QAE@XZ) 외부 기호(참조 위치: "public: __thiscall SFProtobufPacket::SFProtobufPacket(int)" (??0?$SFProtobufPacket@VPlayerInfo@SFPacketStore@@@@QAE@H@Z) 함수)에서 확인하지 못했습니다. \Sample\SevenGameServer\CasualGame.lib(SFCGProtobufProtocol.obj) SevenGameServer
오류 6 error LNK2001: "public: void __thiscall SFPacketStore::PlayerInfo::CopyFrom(class SFPacketStore::PlayerInfo const &)" (?CopyFrom@PlayerInfo@SFPacketStore@@QAEXABV12@@z) 외부 기호를 확인할 수 없습니다. \SnowServer\Sample\SevenGameServer\CasualGame.lib(SFSendPacket.obj) SevenGameServer
오류 4 error LNK2001: "public: virtual __thiscall SFPacketStore::PlayerInfo::~PlayerInfo(void)" (??1PlayerInfo@SFPacketStore@@UAE@XZ) 외부 기호를 확인할 수 없습니다. Sample\SevenGameServer\CasualGame.lib(SFSendPacket.obj) SevenGameServer
오류 2 error LNK2001: "public: __thiscall SFPacketStore::PlayerInfo::PlayerInfo(void)" (??0PlayerInfo@SFPacketStore@@QAE@XZ) 외부 기호를 확인할 수 없습니다. Sample\SevenGameServer\CasualGame.lib(SFSendPacket.obj) SevenGameServer

위는 에러 내용입니다.

Sand측에서 패킷 생성 / 프로토콜 클래스 측에서 정의를 해줘서
각각 3회씩 에러가 났습니다.

protoc -I=. --cpp_out=. SFPacketStore.proto

h, cc파일을 만들때 썻던 명령어입니다.

@pdpdds
Copy link
Owner

pdpdds commented Jan 25, 2016

새로 정의한 프로토 파일을 올려주시면 확인해 보겠습니다.

@woodrockman
Copy link
Author

SFPacketStore.zip

네, 새로 정의한 프로토파일입니다!

@pdpdds
Copy link
Owner

pdpdds commented Jan 25, 2016

컴파일이 안되는게 아니라 새로 작성한 메세지가 동작하지 않는다는 의미가 맞는지요? 예를 들어 Objectinfo 라는 메세지를 추가하려면
BasePacket* SFCGProtobufClientProtocol::CreateIncomingPacketFromPacketId(int packetId)

이 함수내부에서

case CGSF::ObjectInfo:
return new SFProtobufPacketSFPacketStore::ObjectInfo(packetId);

이런식으로 추가해 줘야 합니다.
CGSF::ObjectInfo 와 같은 enum값은 헤더파일에 정의해 줘야 하는데 이참에
구글프로토콜 버퍼내에서 enum값 생성을 하도록 변경하겠습니다.

혹 제가 잘못 이해했다면 다시 알려주세요(컴파일은 문제없지요?)

@woodrockman
Copy link
Author

컴파일이 안되는 문제입니다!
SFCGProtobufClientProtocol.cpp와
SFCGProtobufProtocol.cpp에서 등록하여 생긴 에러이기도 하구요!

혹시 실례가 안된다면, 제가 보낸 proto 파일로
.pb.h, pn.cc 파일을 제작하여 보내주실수 있을까요?
제측의 protoc에서 뭔가 잘못된 생성으로 인하여 생긴 오류일수도 있겠다 라는 생각이 듭니다.

@pdpdds
Copy link
Owner

pdpdds commented Jan 26, 2016

컴파일은 기존에 있던 메시지를 건드려서 안되는 것으로 보입니다(login이나 roomstate 등) 모든 프로젝트를 리빌드해서 에러나는 부분을 수정해 보세요.

@woodrockman
Copy link
Author

기존에 있던 메세지에 관련된 오류는 수정된 상태입니다.
에러의 내용은 처음에 기술했던 내용이 끝이에요!

새로이 CGSF를 설치하여 동작시켜도 같은 현상이 일어나는 것 같습니다.

@pdpdds
Copy link
Owner

pdpdds commented Feb 11, 2016

안녕하세요, 답변이 늦었습니다. 보내주신 프로토 파일은 문제가 있는 것 같습니다(중복 메세지도 보이고 enum 값도 충돌하네요).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants