Hallo,
ich bekomme seit gestern Abend random Kicks.
Syserr sagt nichts.
gdb:
Code
- (gdb) core game.core
- Core was generated by `game'.
- Program terminated with signal 11, Segmentation fault.
- #0 CHARACTER::ChatPacket (this=0x0, format=0x84bb235 "%s") at entity.h:50
- 50 entity.h: No such file or directory.
- in entity.h
- [New Thread 28c1803428c18900 (LWP 100180/<unknown>)]
- [New Thread 88a1a2828c18600 (LWP 100176/<unknown>)]
- [New Thread 28c1893428c18300 (LWP 100175/<unknown>)]
- [New Thread 28c1863428c18000 (LWP 100173/<unknown>)]
- Cannot find new threads: generic error
- (gdb) bt full
- #0 CHARACTER::ChatPacket (this=0x0, format=0x84bb235 "%s") at entity.h:50
- type = Cannot access memory at address 0x0
entity.h existiert aber.
Habe die Datei dann extra nochmal included. Fehler bleibt bestehen.
Sonst hier der erwähnte Codeabschnitt:
C
- void CHARACTER::ChatPacket(BYTE type, const char * format, ...)
- {
- LPDESC d = GetDesc();
- if (!d || !format)
- return;
- char chatbuf[CHAT_MAX_LEN + 1];
- va_list args;
- va_start(args, format);
- int len = vsnprintf(chatbuf, sizeof(chatbuf), format, args);
- va_end(args);
- struct packet_chat pack_chat;
- pack_chat.header = HEADER_GC_CHAT;
- pack_chat.size = sizeof(struct packet_chat) + len;
- pack_chat.type = type;
- pack_chat.id = 0;
- pack_chat.bEmpire = d->GetEmpire();
- TEMP_BUFFER buf;
- buf.write(&pack_chat, sizeof(struct packet_chat));
- buf.write(chatbuf, len);
- d->Packet(buf.read_peek(), buf.size());
- if (type == CHAT_TYPE_COMMAND && test_server)
- sys_log(0, "SEND_COMMAND %s %s", GetName(), chatbuf);
- }
EDIT:
entity.h:
C
- #pragma once
- class SECTREE;
- class CEntity
- {
- public:
- typedef TR1_NS::unordered_map<LPENTITY, int> ENTITY_MAP;
- public:
- CEntity();
- virtual ~CEntity();
- virtual void EncodeInsertPacket(LPENTITY entity) = 0;
- virtual void EncodeRemovePacket(LPENTITY entity) = 0;
- protected:
- void Initialize(int type = -1);
- void Destroy();
- public:
- void SetType(int type);
- int GetType() const;
- bool IsType(int type) const;
- void ViewCleanup();
- void ViewInsert(LPENTITY entity, bool recursive = true);
- void ViewRemove(LPENTITY entity, bool recursive = true);
- void ViewReencode(); // ÁÖÀ§ Entity¿¡ ÆÐŶÀ» ´Ù½Ã º¸³½´Ù.
- int GetViewAge() const { return m_iViewAge; }
- long GetX() const { return m_pos.x; }
- long GetY() const { return m_pos.y; }
- long GetZ() const { return m_pos.z; }
- const PIXEL_POSITION & GetXYZ() const { return m_pos; }
- void SetXYZ(long x, long y, long z) { m_pos.x = x, m_pos.y = y, m_pos.z = z; }
- void SetXYZ(const PIXEL_POSITION & pos) { m_pos = pos; }
- LPSECTREE GetSectree() const { return m_pSectree; }
- void SetSectree(LPSECTREE tree) { m_pSectree = tree; }
- void UpdateSectree();
- void PacketAround(const void * data, int bytes, LPENTITY except = NULL);
- void PacketView(const void * data, int bytes, LPENTITY except = NULL);
- void BindDesc(LPDESC _d) { m_lpDesc = _d; }
- LPDESC GetDesc() const { return m_lpDesc; }
- void SetMapIndex(long l) { m_lMapIndex = l; }
- long GetMapIndex() const { return m_lMapIndex; }
- void SetObserverMode(bool bFlag);
- bool IsObserverMode() const { return m_bIsObserver; }
- protected:
- bool m_bIsObserver;
- bool m_bObserverModeChange;
- ENTITY_MAP m_map_view;
- long m_lMapIndex;
- private:
- LPDESC m_lpDesc;
- int m_iType;
- bool m_bIsDestroyed;
- PIXEL_POSITION m_pos;
- int m_iViewAge;
- LPSECTREE m_pSectree;
- };