Tow
February 7, 2009, 2:46pm
#14
Zapewne inaczej zaimplementowano funkcję clock(), z której brane są te wartości. Ale to raczej niczego nie powinno psuć.
Nie, te wszystkie pliki są wewnątrz archiwum .lod. Jeżeli do samego archiwum się dobrał - a dobrał - to już jego obsługa jest w pełni z naszej strony.
Skoruppa:
Niestety, dalej nic.
Ech, głupi jestem. Elegancko błąd wskazał na substr, a ja naiwnie kombinuję z wektorem. Coś z przetwarzaniem tych plików tekstowych jest nie tak.
Jaką wersję H3 masz tam wgraną? Zwykłą, angielską?
Najlepiej byłoby, jakbyś przeleciał to gdb. Ostatni wypis na log to hch/CGeneralTextHandler.cpp linia 237. Następny jest w linii 251. Nie dochodzi doń, wysypuje się więc gdzie pomiędzy tym. Sypie funkcja substr, więc może być to wywołanie 244. Crash może być, gdy string w tempie ma mniej niż dwa znaki, ale to zdecydowanie nie ma prawa mieć miejsca dla poprawnego tekstu. Alternatywnie błąd może jeszcze być wewnątrz wołanej linię wyżej funkcji loadToIt.
Przejedź po tym, sprawdź w którym momencie i miejscu następuje crash. Jakie w tym momencie są wartości zmiennych - i, it, buf, temp, mines (o ile gdb potrafi to jakoś ładnie wyświetlić).
Złota Edycja. Polska z CD Projektu. Wog angielski.
Na razie mam coś takiego
Starting…
[New Thread 0xb741c700 (LWP 11747)]
[New Thread 0xb741bb90 (LWP 11748)]
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
[New Thread 0xb2ab2b90 (LWP 11749)]
[Thread 0xb2ab2b90 (LWP 11749) exited]
[New Thread 0xb2ab2b90 (LWP 11750)]
Initializing screen: 50000
Initializing minors: 0
Initializing fonts: 0
[New Thread 0xb677eb90 (LWP 11751)]
[New Thread 0xb5f7db90 (LWP 11752)]
Initializing sound: 10000
Initializing screen, fonts and sound handling: 80000
Loading .lod files: 100000
terminate called after throwing an instance of 'std::out_of_range’
what(): basic_string::substr
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb741c700 (LWP 11747)]
0xb7fef430 in __kernel_vsyscall ()
(gdb) list
48 SDL_Surface * screen, * screen2;
49 extern SDL_Surface * CSDL_Ext::std32bppSurface;
50 std::queue<SDL_Event> events;
51 boost::mutex eventsM;
52 TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, GEORM, GEOR16;
53 void processCommand(const std::string &message, CClient &client);
54 #ifndef GNUC
55 int _tmain(int argc, _TCHAR argv])
56 #else
57 int main(int argc, char argv)
(gdb) backtrace
#0 0xb7fb5430 in __kernel_vsyscall ()
#1 0xb79e86a0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb79ea068 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7ca18e8 in __gnu_cxx::__verbose_terminate_handler ()
from /usr/lib/libstdc++.so.6
#4 0xb7c9f7c5 in ?? () from /usr/lib/libstdc++.so.6
#5 0xb7c9f802 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb7c9f93a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0xb7c3691f in std::__throw_out_of_range () from /usr/lib/libstdc++.so.6
#8 0xb7c7c14a in std::string::substr () from /usr/lib/libstdc++.so.6
#9 0x082ab146 in CGeneralTextHandler::load (this=0xb542fbb0)
at …/hch/CGeneralTextHandler.cpp:244
#10 0x082a47d2 in LibClasses::init (this=0xb56b1090) at ./VCMI_Lib.cpp:153
#11 0x082a4cb2 in initDLL (b=0xb560f100, Console=0x8fdb2f0, Logfile=0x8fdb370)
at ./VCMI_Lib.cpp:31
#12 0x0815ae69 in main (argc=Cannot access memory at address 0x2dfb
) at …/CMT.cpp:112
(gdb) info frame
Stack level 0, frame at 0xbffd0a38:
eip = 0xb7fb5430 in __kernel_vsyscall; saved eip 0xb79e86a0
called by frame at 0xbffd0a48
Arglist at 0xbffd0a30, args:
Locals at 0xbffd0a30, Previous frame’s sp is 0xbffd0a38
Saved registers:
ebp at 0xbffd0a28, eip at 0xbffd0a34
Nie wiem czy pomoże. Bardziej chyba debugować nie potrafię zobacze co jeszcze gdb potrafi…
Tow
February 7, 2009, 3:36pm
#16
O, stos wywołań. Widzimy, że sypie linijka 244, zgodnie z przypuszczeniem. Jakbyś ustawił watche na wspomniane zmienne i postawił breakpointa w tejże linii, to może bym wiedział więcej.
Ale… polska wersja może psuć.
Wypakuj to:
forum.vcmi.eu/files/data_119.zip
do podfolderu /Data i sprawdź, czy się coś naprawiło / zmieniło.
Tow
February 7, 2009, 4:28pm
#18
Dziwne, wynika z tego, że czcionki się nie wczytały. (wołanie funkcji drukującej z NULLowym fontem)
Sprawdź, czy oba pliki (Fonts\georgia.ttf i Fonts\tnrb.ttf) są osiągalne z poziomu głównego pliku wykonywalnego.
Czcionki są wczytywane w CMT.cpp w l.97 - 101. Sprawdź wartości otrzymywanych wskaźników (wszystko NULL-e?). Możesz za tym kontrolnie dodać ‘tlog0 << TTF_GetError();’, co powinno wyrzucić na wyjście treść ew. błędu przy ich wczytywaniu.
Haha, dałeś mi dobrą wskazówkę chodziło o dużą literę on szukał w “Fonts” a ja miałem “fonts”. Potem jeszcze kilka błędów i się uruchomiło
Ale z jakiś powodów myszka działa jakby była pijana xD Raz szybciej raz wolniej ale zdecydowanie wolniej niż naprawdę przez co dojadę do końca ekranu a ona zaraz za mną… pomijajac to, pomimo, że denerwujące dałem na Single Scenario->Start i gra się wyłącza (możliwe, że znów problem z polską wersją…). Ach i każda mapa jest dla niego corrupted (czyżby znowu polska wersja?)
logi:
./vcmiclient
Starting…
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 70000
Loading .lod files: 90000
General text handler: 40000
Hero handler: 10000
Artifact handler: 0
Creature handler: 10000
Town handler: 10000
Object handler: 0
Def information handler: 20000
Building handler: 10000
Spell handler: 10000
Initializing VCMI_Lib: 110000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 550000
Main graphics: 780000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 80000
CPreGame: loadgame menu initialization: 80000
Warning: corrupted map file: Maps/Unholy Quest.h3m
Warning: corrupted map file: Maps/Time’s Up.h3m
Warning: corrupted map file: Maps/Hoard(Allies).h3m
Warning: corrupted map file: Maps/Deluge.h3m
Warning: corrupted map file: Maps/Pirates.h3m
Warning: corrupted map file: Maps/Manifest Destiny.h3m
Warning: corrupted map file: Maps/Barbarian Breakout.h3m
Warning: corrupted map file: Maps/Valleys of War.h3m
Warning: corrupted map file: Maps/Too Many Monsters.h3m
Warning: corrupted map file: Maps/Land of Titans (Allied).h3m
Warning: corrupted map file: Maps/Chasing a Dream.h3m
Warning: corrupted map file: Maps/Land of Titans.h3m
Warning: corrupted map file: Maps/Irrational Hostility.h3m
Warning: corrupted map file: Maps/King of Pain.h3m
Warning: corrupted map file: Maps/Golems Aplenty Allied.h3m
Warning: corrupted map file: Maps/Realm of Chaos.h3m
Warning: corrupted map file: Maps/Middletown.h3m
Warning: corrupted map file: Maps/Meeting in Muzgob(Allies).h3m
Warning: corrupted map file: Maps/Tovar’s Fortress.h3m
Warning: corrupted map file: Maps/Back For Revenge.h3m
Warning: corrupted map file: Maps/A Viking We Shall Go Allied.h3m
Warning: corrupted map file: Maps/Darwin’s Prize.h3m
Warning: corrupted map file: Maps/Sangraal’s Thief.h3m
Warning: corrupted map file: Maps/Pestilence Lake Allies.h3m
Warning: corrupted map file: Maps/Serpents Treasure.h3m
Warning: corrupted map file: Maps/Wings of War.h3m
Warning: corrupted map file: Maps/Tale of two lands.h3m
Warning: corrupted map file: Maps/Battle of the Sexes Allied.h3m
Warning: corrupted map file: Maps/Loss of Innocence(Allies).h3m
Warning: corrupted map file: Maps/Dwarven Tunnels(Allies).h3m
Warning: corrupted map file: Maps/Marshland Menace.h3m
Warning: corrupted map file: Maps/Battle of the Sexes.h3m
Warning: corrupted map file: Maps/Search for the Grail.h3m
Warning: corrupted map file: Maps/Resource War.h3m
Warning: corrupted map file: Maps/Rise of the Phoenix Allied.h3m
Warning: corrupted map file: Maps/Gelea’s Champions.h3m
Warning: corrupted map file: Maps/Carpe Diem.h3m
Warning: corrupted map file: Maps/Good to Go.h3m
Warning: corrupted map file: Maps/All for One.h3m
Warning: corrupted map file: Maps/Loss of Innocence.h3m
Warning: corrupted map file: Maps/One Bad Day - Allied.h3m
Warning: corrupted map file: Maps/South of Hell (Allies).h3m
Warning: corrupted map file: Maps/Last Chance.h3m
Warning: corrupted map file: Maps/Elbow Room.h3m
Warning: corrupted map file: Maps/Rebellion.h3m
Warning: corrupted map file: Maps/Race for Ardintinny.h3m
Warning: corrupted map file: Maps/Kingdom for sale.h3m
Warning: corrupted map file: Maps/Tovar’s Fortress (Allies).h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Rise of the Phoenix.h3mMaps/Thousand Islands (allies).h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Meeting in Muzgob.h3mMaps/Cave of Gerfrex.h3m
Warning: corrupted map file:
Maps/Crimson and CloverA.h3m Warning: corrupted map file:
Maps/Titans Winter.h3m Warning: corrupted map file:
Maps/Islands and Caves.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Reclamation.h3mMaps/Last Chance Allies.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/The Newcomers.h3m
Maps/Race for the Town.h3m Warning: corrupted map file:
Maps/Shadow Valleys.h3m Warning: corrupted map file:
Maps/Thousand Islands.h3m Warning: corrupted map file:
Maps/Rumble in the Bogs.h3m Warning: corrupted map file:
Maps/Pandora’s Box .h3m Warning: corrupted map file:
Maps/Just A Visit.h3m Warning: corrupted map file: Maps/Reclamation Allied.h3m
Warning: corrupted map file: Maps/Dragon Orb.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Noahs Ark.h3mMaps/Peacemaker.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Knight of Darkness.h3mMaps/Knee Deep in the Dead.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/A Warm and Familiar Place.h3mMaps/Treasure Hunt.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Divided LoyaltiesA.h3m
Maps/Adventures of Jared Haret.h3m Warning: corrupted map file:
Maps/Jihad.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Faeries.h3mMaps/Emerald IslesA.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Kingdom for sale(allies).h3mMaps/Fort Noxis.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Pestilence Lake.h3mMaps/Dragon Pass (Allies).h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/War of the Mighty.h3mMaps/Heroes of Might not Magic Allied.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Warmongers.h3mMaps/Xathras Prize.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Unexpected Inheritance.h3mMaps/Step by Step.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Good Witch, Bad Witch.h3mMaps/Island King.h3m
Warning: corrupted map file:
Maps/Key to Victory.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/For Sale.h3mMaps/Arrogance3.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Tale of two lands (Allies).h3mMaps/Free for All.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Hold the middle.h3m
Warning: corrupted map file: Maps/Brave New World.h3m
Warning: corrupted map file: Maps/Island King Allied.h3m
Warning: corrupted map file: Maps/Barbarian BreakoutA.h3m
Warning: corrupted map file: Maps/When Dragons Clash.h3m
Warning: corrupted map file: Maps/Terrible Rumor.h3m
Warning: corrupted map file: Maps/Realm of ChaosA.h3m
Warning: corrupted map file: Maps/Golems Aplenty.h3m
Warning: corrupted map file: Maps/Judgement Day.h3m
Warning: corrupted map file: Maps/Divided Loyalties.h3m
Warning: corrupted map file: Maps/The Challenge.h3m
Warning: corrupted map file: Maps/The Mandate of Heaven.h3m
Warning: corrupted map file: Maps/And One for All.h3m
Warning: corrupted map file: Maps/Hatchet Axe and Saw.h3m
Warning: corrupted map file: Maps/Darwin's Prize(Allies).h3m
Warning: corrupted map file: Maps/Sands of Blood.h3m
Warning: corrupted map file: Maps/Arrogance Allied.h3m
Warning: corrupted map file: Maps/Dwarven Tunnels.h3m
Warning: corrupted map file: Maps/Arrogance.h3m
Warning: corrupted map file: Maps/Vial of Life.h3m
Warning: corrupted map file: Maps/Crimson and Clover.h3m
Warning: corrupted map file: Maps/A Viking We Shall Go.h3m
Warning: corrupted map file: Maps/Dead and Buried.h3m
Warning: corrupted map file: Maps/Rumble in the BogsA.h3m
Warning: corrupted map file: Maps/Warlords.h3m
Warning: corrupted map file: Maps/Dragon Pass.h3m
Warning: corrupted map file: Maps/The Five Rings.h3m
Warning: corrupted map file: Maps/Ready or Not.h3m
Warning: corrupted map file: Maps/Sangraal's Thief Allied.h3m
Warning: corrupted map file: Maps/Gorlam's Tentacle Swampland.h3m
Warning: corrupted map file: Maps/Merchant Princes.h3m
Warning: corrupted map file: Maps/Hoard.h3m
Warning: corrupted map file: Maps/The Gauntlet.h3m
Warning: corrupted map file: Maps/Back For Revenge - Allied.h3m
Warning: corrupted map file: Maps/Elbow Room(Allies).h3m
Warning: corrupted map file: Maps/Goblins in the Pantry.h3m
Warning: corrupted map file: Maps/Merchant Princes Allied.h3m
Warning: corrupted map file: Maps/Undead Unrest.h3m
Warning: corrupted map file: Maps/Gelea's Champions (Allies).h3m
Warning: corrupted map file: Maps/Monk's Retreat Allied.h3m
Warning: corrupted map file: Maps/Dungeon Keeper.h3m
Warning: corrupted map file: Maps/Carpe Diem - Allied.h3m
Warning: corrupted map file: Maps/Resource War Allies.h3m
Warning: corrupted map file: Maps/Buried Treasure.h3m
Warning: corrupted map file: Maps/Dwarven Gold.h3m
Warning: corrupted map file: Maps/Freedom.h3m
Warning: corrupted map file: Maps/Southern Cross.h3m
Warning: corrupted map file: Maps/Ascension.h3m
Warning: corrupted map file: Maps/Peaceful Ending - Allied.h3m
Warning: corrupted map file: Maps/Dawn of War.h3m
Warning: corrupted map file: Maps/South of Hell.h3m
Warning: corrupted map file: Maps/Overthrow Thy Neighbors.h3m
Warning: corrupted map file: Maps/Emerald Isles.h3m
Warning: corrupted map file: Maps/The Great Race.h3m
Warning: corrupted map file: Maps/Caught in the Middle.h3m
Warning: corrupted map file: Maps/War of the Mighty (Allies).h3m
Warning: corrupted map file: Maps/Island of Fire.h3m
Warning: corrupted map file: Maps/Twins.h3m
Warning: corrupted map file: Maps/WarlordsA.h3m
Warning: corrupted map file: Maps/The Battle of Daeyan's Ford.h3m
Warning: corrupted map file: Maps/Heroes of Might not Magic.h3m
Warning: corrupted map file: Maps/Step by Step (Allies).h3m
Warning: corrupted map file: Maps/Peaceful Ending.h3m
Warning: corrupted map file: Maps/Monk's Retreat.h3m
Warning: corrupted map file: Maps/Rediscovery.h3m
Maps/Brave New World(Allies).h3m
CPreGame: scenario choice initialization: 160000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 10000
Initialization CPreGame (together): 430000
Initialization of VCMI (together): 1490000
Preparing shared memory and starting server: 0
Waiting for server… 0
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 10000
Gamestate: 0
terminate called after throwing an instance of 'char const*'
Aborted (core dumped)
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 70000
Loading .lod files: 90000
Reading OBJNAMES
Reading ADVEVENT
Reading XTRAINFO
Reading MINENAME
Reading MINEEVNT
Reading RESTYPES
Reading ZCRGN1
General text handler: 40000
Hero handler: 10000
Artifact handler: 0
Reading ZCRTRAIT.TXT
Reading config/crerefnam.txt
Reading config/monsters.txt
Reading config/cr_factions.txt
Reading config/cr_upgrade_list.txt
Reading config/CREDEFS.TXT
We have 197 creatures
Reading CRANIM.TXT.txt
Reading config/cr_shots.txt
Creature handler: 10000
Town handler: 10000
Reading cregens
Done loading objects!
Object handler: 0
Def information handler: 20000
Building handler: 10000
Spell handler: 10000
Initializing VCMI_Lib: 110000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 550000
Main graphics: 780000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 80000
CPreGame: loadgame menu initialization: 80000
Loaded graphics
Warning: corrupted map file: Maps/Unholy Quest.h3m
Warning: corrupted map file: Maps/Time’s Up.h3m
Warning: corrupted map file: Maps/Hoard(Allies).h3m
Warning: corrupted map file: Maps/Deluge.h3m
Warning: corrupted map file: Maps/Pirates.h3m
Warning: corrupted map file: Maps/Manifest Destiny.h3m
Warning: corrupted map file: Maps/Barbarian Breakout.h3m
Warning: corrupted map file: Maps/Valleys of War.h3m
Warning: corrupted map file: Maps/Too Many Monsters.h3m
Warning: corrupted map file: Maps/Land of Titans (Allied).h3m
Warning: corrupted map file: Maps/Chasing a Dream.h3m
Warning: corrupted map file: Maps/Land of Titans.h3m
Warning: corrupted map file: Maps/Irrational Hostility.h3m
Warning: corrupted map file: Maps/King of Pain.h3m
Warning: corrupted map file: Maps/Golems Aplenty Allied.h3m
Warning: corrupted map file: Maps/Realm of Chaos.h3m
Warning: corrupted map file: Maps/Middletown.h3m
Warning: corrupted map file: Maps/Meeting in Muzgob(Allies).h3m
Warning: corrupted map file: Maps/Tovar’s Fortress.h3m
Warning: corrupted map file: Maps/Back For Revenge.h3m
Warning: corrupted map file: Maps/A Viking We Shall Go Allied.h3m
Warning: corrupted map file: Maps/Darwin’s Prize.h3m
Warning: corrupted map file: Maps/Sangraal’s Thief.h3m
Warning: corrupted map file: Maps/Pestilence Lake Allies.h3m
Warning: corrupted map file: Maps/Serpents Treasure.h3m
Warning: corrupted map file: Maps/Wings of War.h3m
Warning: corrupted map file: Maps/Tale of two lands.h3m
Warning: corrupted map file: Maps/Battle of the Sexes Allied.h3m
Warning: corrupted map file: Maps/Loss of Innocence(Allies).h3m
Warning: corrupted map file: Maps/Dwarven Tunnels(Allies).h3m
Warning: corrupted map file: Maps/Marshland Menace.h3m
Warning: corrupted map file: Maps/Battle of the Sexes.h3m
Warning: corrupted map file: Maps/Search for the Grail.h3m
Warning: corrupted map file: Maps/Resource War.h3m
Warning: corrupted map file: Maps/Rise of the Phoenix Allied.h3m
Warning: corrupted map file: Maps/Gelea’s Champions.h3m
Warning: corrupted map file: Maps/Carpe Diem.h3m
Warning: corrupted map file: Maps/Good to Go.h3m
Warning: corrupted map file: Maps/All for One.h3m
Warning: corrupted map file: Maps/Loss of Innocence.h3m
Warning: corrupted map file: Maps/One Bad Day - Allied.h3m
Warning: corrupted map file: Maps/South of Hell (Allies).h3m
Warning: corrupted map file: Maps/Last Chance.h3m
Warning: corrupted map file: Maps/Elbow Room.h3m
Warning: corrupted map file: Maps/Rebellion.h3m
Warning: corrupted map file: Maps/Race for Ardintinny.h3m
Warning: corrupted map file: Maps/Kingdom for sale.h3m
Warning: corrupted map file: Maps/Tovar’s Fortress (Allies).h3m
Warning: corrupted map file: Maps/Rise of the Phoenix.h3mMaps/Thousand Islands (allies).h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Meeting in Muzgob.h3m
Maps/Cave of Gerfrex.h3m Warning: corrupted map file:
Maps/Crimson and CloverA.h3m Warning: corrupted map file:
Maps/Titans Winter.h3mMaps/Islands and Caves.h3mile: Maps/Islands and Caves.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Reclamation.h3mMaps/Last Chance Allies.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/The Newcomers.h3m
Maps/Race for the Town.h3m Warning: corrupted map file:
Maps/Shadow Valleys.h3m Warning: corrupted map file:
Maps/Thousand Islands.h3m Warning: corrupted map file:
Maps/Rumble in the Bogs.h3m Warning: corrupted map file:
Maps/Pandora’s Box .h3m Warning: corrupted map file:
Maps/Just A Visit.h3m Warning: corrupted map file: Maps/Reclamation Allied.h3m
Warning: corrupted map file: Maps/Dragon Orb.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Noahs Ark.h3mMaps/Peacemaker.h3m
Warning: corrupted map file: Maps/Knight of Darkness.h3mMaps/Knee Deep in the Dead.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/A Warm and Familiar Place.h3mMaps/Treasure Hunt.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Divided LoyaltiesA.h3m
Maps/Adventures of Jared Haret.h3m Warning: corrupted map file: Maps/Jihad.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Faeries.h3m
Maps/Emerald IslesA.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Kingdom for sale(allies).h3mMaps/Fort Noxis.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Pestilence Lake.h3mMaps/Dragon Pass (Allies).h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/War of the Mighty.h3m
Maps/Heroes of Might not Magic Allied.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Warmongers.h3mMaps/Xathras Prize.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Unexpected Inheritance.h3mMaps/Step by Step.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Good Witch, Bad Witch.h3m
Maps/Island King.h3m Warning: corrupted map file:
Maps/Key to Victory.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/For Sale.h3mMaps/Arrogance3.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Tale of two lands (Allies).h3mMaps/Free for All.h3m
Warning: corrupted map file: Warning: corrupted map file: Maps/Hold the middle.h3m
Warning: corrupted map file: Maps/Brave New World.h3m
Warning: corrupted map file: Maps/Island King Allied.h3m
Warning: corrupted map file: Maps/Barbarian BreakoutA.h3m
Warning: corrupted map file: Maps/When Dragons Clash.h3m
Warning: corrupted map file: Maps/Terrible Rumor.h3m
Warning: corrupted map file: Maps/Realm of ChaosA.h3m
Warning: corrupted map file: Maps/Golems Aplenty.h3m
Warning: corrupted map file: Maps/Judgement Day.h3m
Warning: corrupted map file: Maps/Divided Loyalties.h3m
Warning: corrupted map file: Maps/The Challenge.h3m
Warning: corrupted map file: Maps/The Mandate of Heaven.h3m
Warning: corrupted map file: Maps/And One for All.h3m
Warning: corrupted map file: Maps/Hatchet Axe and Saw.h3m
Warning: corrupted map file: Maps/Darwin's Prize(Allies).h3m
Warning: corrupted map file: Maps/Sands of Blood.h3m
Warning: corrupted map file: Maps/Arrogance Allied.h3m
Warning: corrupted map file: Maps/Dwarven Tunnels.h3m
Warning: corrupted map file: Maps/Arrogance.h3m
Warning: corrupted map file: Maps/Vial of Life.h3m
Warning: corrupted map file: Maps/Crimson and Clover.h3m
Warning: corrupted map file: Maps/A Viking We Shall Go.h3m
Warning: corrupted map file: Maps/Dead and Buried.h3m
Warning: corrupted map file: Maps/Rumble in the BogsA.h3m
Warning: corrupted map file: Maps/Warlords.h3m
Warning: corrupted map file: Maps/Dragon Pass.h3m
Warning: corrupted map file: Maps/The Five Rings.h3m
Warning: corrupted map file: Maps/Ready or Not.h3m
Warning: corrupted map file: Maps/Sangraal's Thief Allied.h3m
Warning: corrupted map file: Maps/Gorlam's Tentacle Swampland.h3m
Warning: corrupted map file: Maps/Merchant Princes.h3m
Warning: corrupted map file: Maps/Hoard.h3m
Warning: corrupted map file: Maps/The Gauntlet.h3m
Warning: corrupted map file: Maps/Back For Revenge - Allied.h3m
Warning: corrupted map file: Maps/Elbow Room(Allies).h3m
Warning: corrupted map file: Maps/Goblins in the Pantry.h3m
Warning: corrupted map file: Maps/Merchant Princes Allied.h3m
Warning: corrupted map file: Maps/Undead Unrest.h3m
Warning: corrupted map file: Maps/Gelea's Champions (Allies).h3m
Warning: corrupted map file: Maps/Monk's Retreat Allied.h3m
Warning: corrupted map file: Maps/Dungeon Keeper.h3m
Warning: corrupted map file: Maps/Carpe Diem - Allied.h3m
Warning: corrupted map file: Maps/Resource War Allies.h3m
Warning: corrupted map file: Maps/Buried Treasure.h3m
Warning: corrupted map file: Maps/Dwarven Gold.h3m
Warning: corrupted map file: Maps/Freedom.h3m
Warning: corrupted map file: Maps/Southern Cross.h3m
Warning: corrupted map file: Maps/Ascension.h3m
Warning: corrupted map file: Maps/Peaceful Ending - Allied.h3m
Warning: corrupted map file: Maps/Dawn of War.h3m
Warning: corrupted map file: Maps/South of Hell.h3m
Warning: corrupted map file: Maps/Overthrow Thy Neighbors.h3m
Warning: corrupted map file: Maps/Emerald Isles.h3m
Warning: corrupted map file: Maps/The Great Race.h3m
Warning: corrupted map file: Maps/Caught in the Middle.h3m
Warning: corrupted map file: Maps/War of the Mighty (Allies).h3m
Warning: corrupted map file: Maps/Island of Fire.h3m
Warning: corrupted map file: Maps/Twins.h3m
Warning: corrupted map file: Maps/WarlordsA.h3m
Warning: corrupted map file: Maps/The Battle of Daeyan's Ford.h3m
Warning: corrupted map file: Maps/Heroes of Might not Magic.h3m
Warning: corrupted map file: Maps/Step by Step (Allies).h3m
Warning: corrupted map file: Maps/Peaceful Ending.h3m
Warning: corrupted map file: Maps/Monk's Retreat.h3m
Warning: corrupted map file: Maps/Rediscovery.h3m
Maps/Brave New World(Allies).h3m
Loaded maps
CPreGame: scenario choice initialization: 160000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 10000
Initialization CPreGame (together): 430000
Initialization of VCMI (together): 1490000
Preparing shared memory and starting server: 0
Waiting for server… 0
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 10000
Gamestate: 0
gdb (tylko końcówka)
terminate called after throwing an instance of ‘char const*’
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb74b9700 (LWP 15077)]
0xb808c430 in __kernel_vsyscall ()
(gdb) bt
#0 0xb808c430 in __kernel_vsyscall ()
#1 0xb7abf6a0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7ac1068 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7d788e8 in __gnu_cxx::__verbose_terminate_handler ()
from /usr/lib/libstdc++.so.6
#4 0xb7d767c5 in ?? () from /usr/lib/libstdc++.so.6
#5 0xb7d76802 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb7d7693a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x08106281 in CClient::newGame (this=0xbfda8014, con=0xb368a688,
si=0xb36957b8) at ./Client.cpp:746
#8 0x0815b8ac in main (argc=Cannot access memory at address 0x3ae5
) at …/CMT.cpp:179
(gdb) list
48 SDL_Surface * screen, * screen2;
49 extern SDL_Surface * CSDL_Ext::std32bppSurface;
50 std::queue<SDL_Event> events;
51 boost::mutex eventsM;
52 TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, GEORM, GEOR16;
53 void processCommand(const std::string &message, CClient &client);
54 #ifndef GNUC
55 int _tmain(int argc, _TCHAR argv])
56 #else
57 int main(int argc, char argv)
(gdb)
ok, więc coś odkryłem. Jakaś funkcja odwołuję się do folderu maps przez co jak jest Maps to gra się nie włącza. Jednak jak dam maps to on szuka znów map w Maps… podpowiesz mi gdzie to zmienić aby i tu i tu było z małej literki?
EDIT:
Chyba znalazłem
pliczkiTemp.push_back("Maps/"+(dir->path().leaf()));
w cpregame.cpp
Jednak po zmianie, gra się wywala (taki sam efekt otrzymuję jak po prostu skopiuję folder Maps jako maps (aby mieć dwa))
./vcmiclient
Starting…
Creating console and logfile: 0
Loading settings: 30000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 80000
Loading .lod files: 100000
General text handler: 30000
Hero handler: 0
Artifact handler: 10000
Creature handler: 10000
Town handler: 10000
Object handler: 0
Def information handler: 10000
Building handler: 20000
Spell handler: 10000
Initializing VCMI_Lib: 100000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 540000
Main graphics: 840000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 90000
CPreGame: loadgame menu initialization: 80000
Segmentation fault (core dumped)
Creating console and logfile: 0
Loading settings: 30000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 80000
Loading .lod files: 100000
Reading OBJNAMES
Reading ADVEVENT
Reading XTRAINFO
Reading MINENAME
Reading MINEEVNT
Reading RESTYPES
Reading ZCRGN1
General text handler: 30000
Hero handler: 0
Artifact handler: 10000
Reading ZCRTRAIT.TXT
Reading config/crerefnam.txt
Reading config/monsters.txt
Reading config/cr_factions.txt
Reading config/cr_upgrade_list.txt
Reading config/CREDEFS.TXT
We have 197 creatures
Reading CRANIM.TXT.txt
Reading config/cr_shots.txt
Creature handler: 10000
Town handler: 10000
Reading cregens
Done loading objects!
Object handler: 0
Def information handler: 10000
Building handler: 20000
Spell handler: 10000
Initializing VCMI_Lib: 100000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 540000
Main graphics: 840000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 90000
CPreGame: loadgame menu initialization: 80000
Loaded graphics
gdb
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb53ffb90 (LWP 23042)]
0xb7d292ea in std::basic_string<char, std::char_traits, std::allocator >::basic_string () from /usr/lib/libstdc++.so.6
(gdb)bt
#0 0xb7d292ea in std::basic_string<char, std::char_traits, std::allocator >::basic_string () from /usr/lib/libstdc++.so.6
#1 0x08123aaf in PlayerInfo (this=0x8d6f2a0) at …/map.h:111
#2 0x081dfc42 in std::__uninitialized_copy::uninitialized_copy<__gnu_cxx::__normal_iterator<PlayerInfo const*, std::vector<PlayerInfo, std::allocator > >, PlayerInfo*> (__first={_M_current = 0x8d6ee50}, __last=
{_M_current = 0x8d6efe8}, __result=0x8d6f218)
at /usr/include/c++/4.3/bits/stl_uninitialized.h:79
#3 0x081dfd00 in std::uninitialized_copy<__gnu_cxx::__normal_iterator<PlayerInfo const*, std::vector<PlayerInfo, std::allocator > >, PlayerInfo*>
(__first={_M_current = 0x8d6edc8}, __last={_M_current = 0x8d6efe8},
__result=0x8d6f218) at /usr/include/c++/4.3/bits/stl_uninitialized.h:122
#4 0x081dfd21 in std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<PlayerInfo const*, std::vector<PlayerInfo, std::allocator > >, PlayerInfo*, PlayerInfo> (__first={_M_current = 0x8d6edc8}, __last=
{_M_current = 0x8d6efe8}, __result=0x8d6f218)
at /usr/include/c++/4.3/bits/stl_uninitialized.h:262
#5 0x081dfe4d in vector (this=0xb395442c, __x=@0xb53fee78)
at /usr/include/c++/4.3/bits/stl_vector.h:249
#6 0x081e0711 in CMapHeader (this=0xb39543d0) at …/map.h:202
#7 0x081e07fa in CMapInfo (this=0xb39543d0) at …/map.h:231
#8 0x081e0ca8 in __gnu_cxx::new_allocator::construct (
this=0xb388e36c, __p=0xb39543d0, __val=@0xb53fee1c)
—Type to continue, or q to quit—
at /usr/include/c++/4.3/ext/new_allocator.h:108
#9 0x081e5618 in std::vector<CMapInfo, std::allocator >::push_back (
this=0xb388e36c, __x=@0xb53fee1c)
at /usr/include/c++/4.3/bits/stl_vector.h:690
#10 0x081d5cca in MapSel::processMaps (this=0xb388e338,
pliczkiTemp=@0xbff7f750, index=@0xbff7f850) at …/CPreGame.cpp:1095
#11 0x081dde82 in boost::_mfi::mf2<void, MapSel, std::vector<std::string, std::allocatorstd::string >&, int&>::operator() (this=0xb394614c, p=0xb388e338,
a1=@0xbff7f750, a2=@0xbff7f850)
at /usr/include/boost/bind/mem_fn_template.hpp:274
#12 0x081ddf4e in boost::_bi::list3<boost::_bi::value<MapSel*>, boost::reference_wrapper<std::vector<std::string, std::allocatorstd::string > >, boost::reference_wrapper >::operator()<boost::_mfi::mf2<void, MapSel, std::vector<std::string, std::allocatorstd::string >&, int&>, boost::_bi::list0> (
this=0xb3946154, f=@0xb394614c, a=@0xb53ff327)
at /usr/include/boost/bind.hpp:371
#13 0x081ddf93 in boost::_bi::bind_t<void, boost::_mfi::mf2<void, MapSel, std::vector<std::string, std::allocatorstd::string >&, int&>, boost::_bi::list3<boost::_bi::value<MapSel*>, boost::reference_wrapper<std::vector<std::string, std::allocatorstd::string > >, boost::reference_wrapper > >::operator() (
this=0xb394614c) at /usr/include/boost/bind/bind_template.hpp:20
#14 0x081ddfac in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf2<void, MapSel, std::vector<std::string, std::allocatorstd::string >&, in—Type to continue, or q to quit—
t&>, boost::_bi::list3<boost::_bi::value<MapSel*>, boost::reference_wrapper<std::vector<std::string, std::allocatorstd::string > >, boost::reference_wrapper > > >::run (this=0xb3946090)
at /usr/include/boost/thread/detail/thread.hpp:56
#15 0xb8023848 in thread_proxy () from /usr/lib/libboost_thread-mt.so.1.37.0
#16 0xb7f734ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#17 0xb7b4e3fe in clone () from /lib/tls/i686/cmov/libc.so.6
Tow
February 8, 2009, 7:01am
#21
Wygląda na ten sam bug z wczytywaniem map, do któéego dotarł Dikamilo. Problem nietyle z Linuksem, ile z GCC. Nie mam na to dobrego pomysłu.
Przerobiłem na razie kod odpowiadający za wczytywanie map. Uaktualnij źródła i wypróbuj. Nawet jeśli nie zadziała, to przynajmniej powinno się ciekawiej wysypywać.
Więc ukłony bo najwyraźniej już dobrze wczytuje mapy. Ignorując problem z myszką postanowiłem uruchomić grę. Kiedy wybiorę mapę z oryginalnych Herosów (czyli tych polskich) to jest taki log:
./vcmiclient
Starting…
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 40000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 80000
Loading .lod files: 90000
General text handler: 30000
Hero handler: 10000
Artifact handler: 0
Creature handler: 20000
Town handler: 0
Object handler: 0
Def information handler: 30000
Building handler: 0
Spell handler: 20000
Initializing VCMI_Lib: 110000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 640000
Main graphics: 910000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 80000
CPreGame: loadgame menu initialization: 80000
CPreGame: scenario choice initialization: 130000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 10000
Initialization CPreGame (together): 400000
Initialization of VCMI (together): 1600000
Preparing shared memory and starting server: 0
Waiting for server… 10000
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 0
Gamestate: 0
Server opened map properly.
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::system::system_error >'
what(): Connection reset by peer
Segmentation fault (core dumped)
Aborted (core dumped)
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 40000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 20000
Initializing screen, fonts and sound handling: 80000
Loading .lod files: 90000
Reading OBJNAMES
Reading ADVEVENT
Reading XTRAINFO
Reading MINENAME
Reading MINEEVNT
Reading RESTYPES
Reading ZCRGN1
General text handler: 30000
Hero handler: 10000
Artifact handler: 0
Reading ZCRTRAIT.TXT
Reading config/crerefnam.txt
Reading config/monsters.txt
Reading config/cr_factions.txt
Reading config/cr_upgrade_list.txt
Reading config/CREDEFS.TXT
We have 197 creatures
Reading CRANIM.TXT.txt
Reading config/cr_shots.txt
Creature handler: 20000
Town handler: 0
Reading cregens
Done loading objects!
Object handler: 0
Def information handler: 30000
Building handler: 0
Spell handler: 20000
Initializing VCMI_Lib: 110000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 640000
Main graphics: 910000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 80000
CPreGame: newgame menu initialization: 80000
CPreGame: loadgame menu initialization: 80000
Loaded graphics
Loaded maps
CPreGame: scenario choice initialization: 130000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 10000
Initialization CPreGame (together): 400000
Initialization of VCMI (together): 1600000
Preparing shared memory and starting server: 0
Waiting for server… 10000
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 0
Gamestate: 0
Server opened map properly.
gdb
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb7353700 (LWP 12186)]
0xb7f26430 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7f26430 in __kernel_vsyscall ()
#1 0xb79596a0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb795b068 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7c128e8 in __gnu_cxx::__verbose_terminate_handler ()
from /usr/lib/libstdc++.so.6
#4 0xb7c107c5 in ?? () from /usr/lib/libstdc++.so.6
#5 0xb7c10802 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb7c1093a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x0828cda9 in boost::throw_exceptionboost::system::system_error (
e=@0xbfc41c0c) at /usr/include/boost/throw_exception.hpp:64
#8 0x0828cf13 in boost::asio::detail::throw_error (err=@0xbfc41c48)
at /usr/include/boost/asio/detail/throw_error.hpp:36
#9 0x0828f4df in boost::asio::read<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_serviceboost::asio::ip::tcp >, boost::asio::mutable_buffers_1> (s=@0xb65b658, buffers=@0xbfc41c84)
at /usr/include/boost/asio/impl/read.ipp:63
#10 0x0828654c in CConnection::read (this=0xb87a360, data=0xbfc41d0c, size=4)
at ./Connection.cpp:127
#11 0x08121572 in CISer::loadPrimitive (
this=0xb87a360, data=@0xbfc41d0c) at ./Connection.h:345
#12 0x0812158c in LoadPrimitive<CConnection, unsigned int>::invoke (
s=@0xb87a360, data=@0xbfc41d0c) at ./Connection.h:80
#13 0x081215b0 in CISer::load (this=0xb87a360,
—Type to continue, or q to quit—
data=@0xbfc41d0c) at ./Connection.h:340
#14 0x081215d4 in CISer::operator>> (
this=0xb87a360, t=@0xbfc41d0c) at ./Connection.h:307
#15 0x08123184 in CISer::loadSerializable (this=0xb87a360,
data=@0xbfc41ddc) at ./Connection.h:429
#16 0x081231e0 in LoadSerializable<CConnection, std::string>::invoke (
s=@0xb87a360, data=@0xbfc41ddc) at ./Connection.h:120
#17 0x08123204 in CISer::loadstd::string (this=0xb87a360,
data=@0xbfc41ddc) at ./Connection.h:340
#18 0x08123228 in CISer::operator>>std::string (this=0xb87a360,
t=@0xbfc41ddc) at ./Connection.h:307
#19 0x081063b2 in CClient::newGame (this=0xbfc41eb4, con=0xb87a360,
si=0xb856378) at ./Client.cpp:759
#20 0x0815c8b8 in main (argc=Cannot access memory at address 0x2f9a
) at …/CMT.cpp:179
(gdb)
Gdy wybiorę mapę z WoG
./vcmiclient
Starting…
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 10000
Initializing screen, fonts and sound handling: 60000
Loading .lod files: 100000
General text handler: 30000
Hero handler: 0
Artifact handler: 0
Creature handler: 20000
Town handler: 0
Object handler: 0
Def information handler: 20000
Building handler: 10000
Spell handler: 10000
Initializing VCMI_Lib: 90000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 510000
Main graphics: 810000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 90000
CPreGame: newgame menu initialization: 90000
CPreGame: loadgame menu initialization: 80000
CPreGame: scenario choice initialization: 150000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 0
Initialization CPreGame (together): 440000
Initialization of VCMI (together): 1510000
Preparing shared memory and starting server: 0
Waiting for server… 0
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 0
Gamestate: 0
Server opened map properly.
Sending/Getting info to/from the server: 0
Opening map file: Maps/Cave of Gerfrex.h3m done.
Our map checksum: 352216569
Reading header: 0
Reading rumors: 0
Reading predefined heroes: 0
Reading terrain: 10000
Reading defs info: 0
Reading objects: 0
Reading events: 0
Calculating blocked/visitable tiles: 0
Reading and detecting map file (together): 40000
Server checksum for Maps/Cave of Gerfrex.h3m: 352216569
Our checksum for the map: 352216569
Using random seed: 1626001597
Initializing GameState (together): 20000
Creating mapHandler: 0
Loading town def info: 0
Segmentation fault (core dumped)
Unpacking and handling defs: 320000
Checking used heroes: 0
Collecting loaded def’s handlers: 0
Preparing FoW, roads, rivers,borders: 40000
Making object rects: 10000
Initializing mapHandler (together): 370000
Segmentation fault (core dumped)
Creating console and logfile: 0
Loading settings: 20000
VCMI 0.7b (client)
Initializing screen: 30000
Initializing minors: 0
Initializing fonts: 0
Initializing sound: 10000
Initializing screen, fonts and sound handling: 60000
Loading .lod files: 100000
Reading OBJNAMES
Reading ADVEVENT
Reading XTRAINFO
Reading MINENAME
Reading MINEEVNT
Reading RESTYPES
Reading ZCRGN1
General text handler: 30000
Hero handler: 0
Artifact handler: 0
Reading ZCRTRAIT.TXT
Reading config/crerefnam.txt
Reading config/monsters.txt
Reading config/cr_factions.txt
Reading config/cr_upgrade_list.txt
Reading config/CREDEFS.TXT
We have 197 creatures
Reading CRANIM.TXT.txt
Reading config/cr_shots.txt
Creature handler: 20000
Town handler: 0
Reading cregens
Done loading objects!
Object handler: 0
Def information handler: 20000
Building handler: 10000
Spell handler: 10000
Initializing VCMI_Lib: 90000
Screen handler: 0
Ability handler: 0
Pathfinder: 0
Preparing first handlers: 0
Loading and transforming heroes’ flags: 510000
Main graphics: 810000
Initializing game graphics: 0
Message handler: 10000
CPreGame: main menu initialization: 90000
CPreGame: newgame menu initialization: 90000
CPreGame: loadgame menu initialization: 80000
Loaded graphics
Loaded maps
CPreGame: scenario choice initialization: 150000
CPreGame: scenario options initialization: 20000
CPreGame: displaying main menu: 0
Initialization CPreGame (together): 440000
Initialization of VCMI (together): 1510000
Preparing shared memory and starting server: 0
Waiting for server… 0
Establishing connection…
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Established connection with VCMI 0.7b (server)
Connecting to the server: 0
Gamestate: 0
Server opened map properly.
Sending/Getting info to/from the server: 0
Opening map file: Maps/Cave of Gerfrex.h3m done.
Our map checksum: 352216569
Reading header: 0
Reading rumors: 0
Reading predefined heroes: 0
Reading terrain: 10000
Reading defs info: 0
Reading objects: 0
Reading events: 0
Calculating blocked/visitable tiles: 0
Reading and detecting map file (together): 40000
Server checksum for Maps/Cave of Gerfrex.h3m: 352216569
Our checksum for the map: 352216569
Using random seed: 1626001597
Initializing GameState (together): 20000
Creating mapHandler: 0
Loading town def info: 0
Unpacking and handling defs: 320000
Checking used heroes: 0
Collecting loaded def’s handlers: 0
Preparing FoW, roads, rivers,borders: 40000
Making object rects: 10000
Initializing mapHandler (together): 370000
gdb
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb74b7700 (LWP 12271)]
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x080f1e65 in CAIHandler::getNewAI (cb=0xb9cc808, dllname=
{static npos = 4294967295, _M_dataplus = {<std::allocator> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0xbf8a7214 “4J�\n\b�\234\v”}}) at …/CGameInterface.cpp:49
#2 0x0810693d in CClient::newGame (this=0xbf8a7314, con=0xaa49218,
si=0xaa4e508) at ./Client.cpp:790
#3 0x0815c8b8 in main (argc=-1207271436, argv=0xbf8a7554) at …/CMT.cpp:179
(gdb)
Jako że nasze “problemy” tyczą się praktycznie tego samego, pozwolę sobie napisać w tym temacie.
Więc, wprowadzone zmiany są na duży plus. Jednak pojawił się następny problem, mianowicie z połączeniem do serwera, gdy wybieram mapę (obojętnie z jakiej wersji), client ładuje serwer następnie serwer zamyka się i gra stoi, w logach widać to:
client:
...
Initialization CPreGame (together): 953
Initialization of VCMI (together): 3859
Preparing shared memory and starting server: 32
Waiting for server... 2344
Establishing connection...
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Przy niektórych mapach klient wywala takie coś:
Establishing connection...
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Cannot establish connection! Retrying within 2 seconds
Establishing connection...
Found endpoints:
0: 127.0.0.1:3030
Trying connection to 127.0.0.1:3030 (0)
Problem with connecting:
system:10061
Something went wrong... checking for error info
system:10061
server:
...
CVCMIServer created!
Listening for connections at port 3030
We've accepted someone...
Próbowano przeprowadzić próbę na obiekcie, który nie jest gniazdem
Mam podlinkowane liby wsock32 oraz ws2_32 (od winsock) w serverze i dll. gdb nie pokazuje nic, bo to serwer się wychacza.
===
Podam jeszcze niezbędnie zmiany aby VCMI dal się skompilować na mingw, może będzieice chcieli to dodać :]
problem z konsolą (gra nie loguje do okna tylko do 2 lików txt):
w CMP.cpp dodać po includach:
#if __MINGW32__
#undef main
#endif
undefined reference to genRect i SDL_PutPixelWithoutRefresh
Przenieść wymienione funkcie (inline) z SDL_Exceptions.cpp do SDL_Exceptions.h
Tow
February 8, 2009, 2:56pm
#24
Najlepiej by było, gdybyś zrobił z tego łatkę ( .diff / .patch) i mi podesłał/załączył - wgrałbym na repozytorium i byś nie miał konfliktu
Serwer wywala się na wczytywaniu mapy.
Start gry wygląda tak - po wyborze mapy, klient uruchamia serwer, czeka nań, łączy się i wysyła nazwę mapy i ustawienia początkowe. Potem czekamy, aż serwer odeśle nam swoje informacje. Następnie klient wczytuje mapę.
Serwer po otrzymaniu informacji startowych wczytuje mapę i dopiero potem przekazuje resztę informacji klientowi. Jeżeli serwer na wczytywaniu mapy się wykrzaczy, pójdzie za nim i klient (bo połączenie się popsuje).
Tak właśnie było w tym przypadku - klient się wysypał, bo połączenie z serwerem siadło. A siadło, bo serwer się wysypał na tej mapie.
Żeby powiedzieć coś więcej, musiałbym znać mapę i zobaczyć stos wywołań serwera w chwili crasha. Ten z klienta mówi tylko: “to nie ja!”.
O, już bardzo daleko zaszedł. To ostatni krok przed rozpoczęciem rozgrywki - wczytanie AI. Pewnie nie jest w stanie wczytać pliku AI/GeniusAI.dll - przypuszczam, że zbudowaną bibliotekę z AI nazwało inaczej. Możesz zmienić jej nazwę, albo zmienić nazwę szukanego pliku w config/settings.txt (wpis defaultAI=GeniusAI.dll;).
Oto łatka w załączniku, zmiany które wymieniłem w poprzednim poście + pliki projektów dla Code::Blocks.
Tow:
“Popełniłem”
Dzięki!
Jak byś mógł jeszcze tego wgrać, bo w tamtym kilka błędów było (nie sprawdziłem przed wysłaniem)
mingw_r718.rar (5.66 KB)
Tow
February 8, 2009, 4:40pm
#28
Zrobione, sam zresztą powinienem był uważniej rzucić okiem.
Co do samego błędu, na którym utknąłeś, to nie bardzo mam pomysł. Sieć coś dziwnie działa. Zastanawiające o tyle, że Skoruppa przez ten etap przebrnął akurat dość bezboleśnie, więc to raczej nie problem stricte związany z GCC.
Co do samego błędu, na którym utknąłeś, to nie bardzo mam pomysł. Sieć coś dziwnie działa. Zastanawiające o tyle, że Skoruppa przez ten etap przebrnął akurat dość bezboleśnie, więc to raczej nie problem stricte związany z GCC.
Naprawiłem Trzeba było dodać flagę _WIN32_WINNT <- sam boost asio o to krzyczał
Wszystkie mapy ładują się poprawnie, wiec nie ma tego problemu który występuje u Skoruppa.
Pierwszy błąd prawie na 100% powoduję polska wersja Drugi pewnie powoduję brak AI bo wstyd się przyznać ale nie skompilowałem. Dikamilo: jak kompilujesz AI? (tak, po prostu mi nie wychodzi :P)
Ja importowałem projekt Visuala i dolinkowałem mu liba VCMI, dodatkowo takie #defines:
WIN32
_WINDOWS
_USRDLL
GENIUS_EXPORTS
Mam jeszcze w projekcie podana ścieżkę do include i libs z boosta ale żaden lib nie jest potrzebny
A pliki w projekcie to:
CGeniusAI.h
CGeniusAI.cpp
DLLMain.cpp
A mógłby mi ktoś wygenerować makefile? Bo ja jestem chyba zbyt wielki amator
EDIT:
Czego bym nie próbował to zawsze
Może coś źle robię…
Zaktualizuj źródła tam jest patch który to poprawia, albo zmień (CGeniusAI.h):
void CBattleLogic::PrintBattleAction(const BattleAction &action);
na
void PrintBattleAction(const BattleAction &action);