Giter Site home page Giter Site logo

fb's People

Contributors

boyism80 avatar cshyeonmojito avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fb's Issues

DB 저장

  • 주기별로 DB 저장
  • config 파일에 주기 설정
  • docker gracefully shutdown( + exit thread)

루아스크립트 개선

  • lua_checkstack를 이용해 스택 사이즈 수정
  • lua_newstate를 다시 lua_newthread로 변경
  • 최초 한번 스크립트 로드하고 dofile 대신 dostring으로 수정(스크립트 내용 메모리에 올리기)
  • 모든 스레드가 공유할 수 있는 변수 관리하기 (현재 env로 사용하는거)
  • 스레드별로 state를 나누는 구조로 변경
  • 스레드 가비지컬렉터 호출

참고자료

스레드 개선

C++11 문법으로 변경

  • 생성자 정의부에서 값 할당
  • smart pointer 적용되지 않는 코드들 적용 답없다
  • typedef > using
  • override > final 적용할 수 있는 부분 적용
  • 싱글톤 std::call_once로 thread safe
  • constexpr로 변경할 수 있는거 확인 후 변경
  • enum > enum class

스펠 버그

  • 루아 빌트인 front:is 부분에서 버그 발생
  • 스펠 남은시간이 표시되지 않음

권한

  • 관리자 권한 추가
  • 일반명령어/관리자 명령어 구분
  • 타일무시 스킬 / 관리자 플래그 buildin 함수
  • 타일확인 플래그

섹터 스레드 임계영역 문제

맵이 변경되고
이전맵의 섹터에서 자기 자신을 제거하고, 새 맵 소유의 섹터에서 자기 자신을 추가해야하는데
두 섹터에 접근하는 스레드가 서로 달라야하는데 지금은 새 맵의 스레드에서 다 해버리는 바람에 에러남

코드 리팩토링

  • 불필요한 explicit 생성자 제거
  • spell _time std::chrono로 수정 + acceptor::_accept_delay
  • item.base trade, storage public const
  • ifndef define 공백 수정

코드 리팩토링

  • object의 맵 이동에서 session으로 캐스팅하지 않고 가상 메소드로 처리
    if(this->is(fb::game::object::types::SESSION))
  • on_ma_changed에서 db save
    if(this->is(fb::game::object::types::SESSION))
  • switch_process 메소드 이름 변경하고 session과 관계 없이 map.group 비교
    if(this->is(fb::game::object::types::SESSION) == false)
  • object에 정의된 handle_~로 시작하는 가상메소드 전부 on_로 변경
  • builtin 구현 정의된 cpp 파일 분리
  • 프로토콜 헤더 위치 수정

맵 섹터 버그

몹 이상하게 사라졌다 나타났다 하는 현상 원인 파악 후 수정
맵번호 4486

다중 접속 허용 방지

  • 맵 이동할 때마다 DB 저장
  • 접속중인 유저가 존재할 때 바로 접속 허용하지 않고 이미 접속중이라고 노티

헤더파일 경로 수정

  • context, acceptor 둘 중 하나로 네이밍
  • sql.service 네이밍 수정, 서비스 개념을 억지로 넣으면서 네임스페이스가 역겨워졌음 수정 필요
  • 모든 서버 공용으로 사용하는 코드는 core로 네이밍 (e.g. fb/core/config)
  • 헤더파일 확장자 제거
  • 프로토콜 파일 정리
  • Makefile 다시 작성
  • plugin을 include에서 정리, mysql+++의 경우 windows, linux 파일 따로 안하게

스마트포인터

  • acceptor를 상속받는 클래스 이름 context로 용어 변경
  • fb::game::context::object를 fb::game::object와 fb::game::map이 상속받도록 수정 (더 이상 루아 레퍼런스로 접근 X)
  • context에서 관리하던 _hash_set의 이름을 _object로 변경하고 데이터 생성될때마다 unique_ptr로 관리
    hash_set _hash_set;
  • acceptor가 accept 하는 과정에서 생성한 소켓 스마트포인터로 변경
    this->_buffer = new S<T>(this->_context, std::bind(&fb::base::acceptor<S, T>::handle_receive, this, std::placeholders::_1), std::bind(&fb::base::acceptor<S, T>::handle_closed, this, std::placeholders::_1));
  • command_dict를 commands로 변경
    command_dict _command_dict;
  • socket에서 data를 unique_ptr로 관리하지 않게 수정
    std::unique_ptr<T> _data;
  • container에서 데이터 포인터 array로 관리하게 수정
    T** _elements = nullptr;
  • map이 관리하는 objects가 자체적으로 메모리 해제하지 않고 포인터만 가리키도록 수정
    void fb::game::objects::clear()
  • DB 스마트포인터 적용
  • 그룹 스마트포인터 적용
  • 버프 스마트포인터 적용
  • new 키워드 최대한 사용하지 않도록 코드 변경
  • ctx를 context로 이름 바꾸고 object의 리턴타입을 구체적으로 명시
  • context 접근 방식 문제
  • make_unique를 사용하지 않고 직접 생성하는 것들 전부 수정
  • emplace_back으로 변경할만한것들 변경

패킷 변조 방어

  • 로그인 패킷에 map, position 정보가 주입된 경우 DB 데이터와 비교 후 검사

NPC 스크립트

  • npc 스크립트 경로 const로 픽스
  • 존재하지 않는 스크립트는 더미로 만들기
  • 스크립트 존재하지 않으면 로딩시 에러 로그 출력
  • 함수 이름 규칙 정의
  • spell concast 삭제되지 않은 로직 제거
    if(std::filesystem::exists(concast) == false)

게시판 구조 변경

board > section > article
DB에 적재할 수 있는 구조로 변경

  • 게시글 쓰기 권한
  • 게시글 작성
  • 게시글 삭제
  • DB 에러 예외처리
  • board message 응답 클래스의 success, refresh 파라미터 변경
  • 문자열 길이 제한
  • section은 테이블로 관리하고 article만 db로 관리

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.